M3.6: integrated terminal with PTY sessions and xterm.js sub-tabs
- crates/terminal: portable-pty sessions (ConPTY on Windows) with reader, writer and waiter threads, UTF-8 chunking, a 1 MiB output buffer with backpressure, a non-blocking input queue, resize, kill and exit codes; default shell pwsh -> powershell -> cmd on Windows, $SHELL or /bin/sh. - Engine: terminal.create/input/resize/close, terminalOutput (capped per terminal and per pump, round-robin) and terminalExited through the pump; terminals close with the project and on app.quit. - UI: Terminal tab in the bottom panel (tabs next to Find), xterm.js with the fit addon, sub-tabs, copy/paste, a focus rule that leaves plain Ctrl keys to the shell, terminal.open (Mod+Shift+T), --lt-terminal-* ANSI tokens in both themes (text colours AA) and a 4.5:1 minimum contrast. - Tests: real-shell crate tests (UTF-8, backpressure), engine and TCP control tests, Vitest with a mocked xterm; live check on port 7936; docs and parity rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5fa7f0c8b3
commit
a8daf269fb
45 changed files with 3935 additions and 49 deletions
|
|
@ -119,6 +119,7 @@ impl Engine {
|
|||
}
|
||||
let outcome = command.run(state, params);
|
||||
crate::workspace::sync_buffer_dirs(state);
|
||||
cmd::terminal::sync_project(state);
|
||||
outcome
|
||||
});
|
||||
state.commands_run = state.commands_run.saturating_add(1);
|
||||
|
|
@ -134,6 +135,7 @@ impl Engine {
|
|||
/// events (see [`cmd::search`]), merges index updates (see
|
||||
/// [`cmd::goto`]), stores finished parses and starts due ones (see
|
||||
/// [`cmd::syntax`]) and returns every queued event.
|
||||
/// Terminal output and exits become events too (see [`cmd::terminal`]).
|
||||
/// Hosts call it regularly, e.g. every 100 ms from a background thread.
|
||||
///
|
||||
/// # Errors
|
||||
|
|
@ -148,6 +150,7 @@ impl Engine {
|
|||
cmd::goto::sync(state);
|
||||
cmd::syntax::pump(state, std::time::Instant::now());
|
||||
cmd::toolchain::pump(state);
|
||||
cmd::terminal::pump(state);
|
||||
Ok(())
|
||||
})?;
|
||||
Ok(state.take_events())
|
||||
|
|
@ -410,6 +413,10 @@ mod tests {
|
|||
"settings.reset",
|
||||
"settings.set",
|
||||
"syntax.outline",
|
||||
"terminal.close",
|
||||
"terminal.create",
|
||||
"terminal.input",
|
||||
"terminal.resize",
|
||||
"test.disabled",
|
||||
"theme.list",
|
||||
"theme.systemPreference",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue