Skip to content

Integrated terminal - #38

Open
rudalabs wants to merge 2 commits into
XyleMora:mainfrom
rudalabs:integrated-terminal
Open

rudalabs wants to merge 2 commits into
XyleMora:mainfrom
rudalabs:integrated-terminal

Conversation

@rudalabs

@rudalabs rudalabs commented Nov 8, 2026 •

Copy link
Copy Markdown

The terminal on its own. The folder chooser and gallery zoom moved to #40.

Depends on #40: this branch is built on top of it, so until #40 is merged the diff here also shows its commits. Only the last commit, "Integrated terminal", belongs to this PR.

Integrated terminal

  • A terminal button in the header of all three pages (or Ctrl+`) opens a panel at the bottom, like VS Code or JetBrains IDEs. Drag its top edge to resize it.
  • It runs the user's $SHELL on a pseudo-terminal (src-tauri/src/terminal.rs, posix_openpt through libc, no pty crate), started in the open project's folder (folder= / local=) or the home folder, with the AppImage environment removed.
  • Output is drawn by a small DOM-free emulator (src/desktop/vt.js): colours (16/256/true colour), cursor movement, scroll regions, the alternate screen (less, vim, top), bracketed paste and 5,000 lines of scrollback.
  • Hiding the panel keeps the shell running, and so does moving between pages: the next page reattaches and replays the recent output (256 KB backlog). × ends the shell (hang-up, then a kill after 2 s); exit closes the panel.
  • Ctrl+C copies when text is selected, else interrupts; Ctrl+V / Ctrl+Shift+V paste.
  • Unix only: on Windows the commands report that the terminal isn't available.

Testing

  • cargo test --locked --lib: 23 passed, 3 ignored (the ones needing the network or an installed KiCad), including a test that runs a shell on the pty (window size, starting folder, controlling terminal, ending it).
  • The panel hasn't been tried in the real app window yet.

The new direct dependency libc (Unix) was already in the tree through Tauri, so Cargo.lock gains no packages.

🤖 Generated with Claude Code

@XyleMora

XyleMora commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Hi @rudalabs, thank you very much for your interest and contribution to KiVi. Would it be possible to split this pull request into several separate pull requests:

  • Minor improvements: system folder chooser, gallery zoom
  • Major new feature: integrated terminal

I would like to also hear about integrated terminal idea more, how KiVi will benefit from it?

@rudalabs

rudalabs commented Nov 9, 2026

Copy link
Copy Markdown
Author

Integrated Development environments like CLion, VSCode etc. all give the user the possibility to open a terminal as part of the IDE without it being a separate window. Now I know this is not an IDE but a lot of nerds are used to using the terminal for all commands related to engineering work (git, pio, etc.). Since this KiVi tool works well with git, I thought it'd be cool to be able to run commands in an intergrated terminal while working without it being a seperate window.

- Terminal panel at the bottom of every desktop page (header button or Ctrl+`): the user's shell on a pty (terminal.rs, libc posix_openpt), drawn by a small DOM-free emulator (vt.js); reattaches across pages.
- The shell starts with default signal handling; closing hangs up the process group, then kills it 2 s later; the terminal ends when the shell exits, even if something it started still holds the pty.
- Unix only: on Windows the commands report that the terminal isn't available.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rudalabs
rudalabs force-pushed the integrated-terminal branch from 986dcb0 to 350168e Compare November 9, 2026 15:07
@rudalabs rudalabs changed the title Integrated terminal, system folder chooser, gallery zoom Integrated terminal Nov 9, 2026
@rudalabs

rudalabs commented Nov 9, 2026

Copy link
Copy Markdown
Author

I had Claude split this into 2 MRs like you asked.

@XyleMora

XyleMora commented Nov 9, 2026

Copy link
Copy Markdown
Owner

@rudalabs thank you very much. #40 has been merged successfully. Let me look into integrated terminal PR more in depth and test it out.

# Conflicts:
#	src/desktop/account.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants