Skip to content

feat: experimental shell/terminal integration#872

Merged
reubeno merged 9 commits into
mainfrom
shell-integration
Dec 25, 2025
Merged

feat: experimental shell/terminal integration#872
reubeno merged 9 commits into
mainfrom
shell-integration

Conversation

@reubeno
Copy link
Copy Markdown
Owner

@reubeno reubeno commented Dec 25, 2025

Initial experimental implementation of terminal integration via OSC sequences. Includes non-trivial refactoring to brush-interactive crate.

The new functionality is gated on an experimental command-line option (--enable-terminal-integration). It's only been tested with VSCode as first primary target. We'll continue to mature it in-tree if there's sufficient interest.

image

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 25, 2025

Test Results

    3 files     26 suites   10m 25s ⏱️
1 450 tests 1 450 ✅ 0 💤 0 ❌
4 330 runs  4 330 ✅ 0 💤 0 ❌

Results for commit 73a97e9.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 25, 2025

Public API changes for crate: brush-interactive

Removed items

-pub trait brush_interactive::InteractiveShellExt
-pub async fn brush_interactive::InteractiveShellExt::run_interactively(&self, input: &mut impl brush_interactive::InputBackend) -> core::result::Result<(), brush_interactive::ShellError>
-pub async fn brush_interactive::InteractiveShellExt::run_interactively_once(&self, input: &mut impl brush_interactive::InputBackend) -> core::result::Result<brush_interactive::InteractiveExecutionResult, brush_interactive::ShellError>
-impl brush_interactive::InteractiveShellExt for brush_interactive::ShellRef
-pub async fn brush_interactive::ShellRef::run_interactively(&self, input: &mut impl brush_interactive::InputBackend) -> core::result::Result<(), brush_interactive::ShellError>
-pub async fn brush_interactive::ShellRef::run_interactively_once(&self, input: &mut impl brush_interactive::InputBackend) -> core::result::Result<brush_interactive::InteractiveExecutionResult, brush_interactive::ShellError>

Added items

+impl core::convert::From<&brush_interactive::InteractiveExecutionResult> for i32
+pub fn i32::from(value: &brush_interactive::InteractiveExecutionResult) -> Self
+pub struct brush_interactive::InteractiveShell<'a, IB: brush_interactive::InputBackend>
+impl<'a, IB: brush_interactive::InputBackend> brush_interactive::InteractiveShell<'a, IB>
+pub fn brush_interactive::InteractiveShell<'a, IB>::new(shell: &brush_interactive::ShellRef, input: &'a mut IB, options: &brush_interactive::UIOptions) -> core::result::Result<Self, brush_interactive::ShellError>
+pub async fn brush_interactive::InteractiveShell<'a, IB>::run_interactively(&mut self) -> core::result::Result<(), brush_interactive::ShellError>
+pub brush_interactive::UIOptions::terminal_shell_integration: bool

Public API changes for crate: brush-shell

Added items

+pub brush_shell::args::CommandLineArgs::terminal_shell_integration: bool

Changed items

-pub brush_shell::args::CommandLineArgs::enable_highlighting: core::option::Option<bool>
+pub brush_shell::args::CommandLineArgs::enable_highlighting: bool

Performance Benchmark Report

Benchmark name Baseline (μs) Test/PR (μs) Delta (μs) Delta %
clone_shell_object 17.82 μs 18.00 μs 0.18 μs 🟠 +1.00%
eval_arithmetic 0.15 μs 0.15 μs 0.00 μs ⚪ Unchanged
expand_one_string 1.62 μs 1.59 μs -0.03 μs ⚪ Unchanged
for_loop 22.59 μs 22.43 μs -0.16 μs ⚪ Unchanged
function_call 2.39 μs 2.32 μs -0.07 μs ⚪ Unchanged
instantiate_shell 54.21 μs 54.38 μs 0.17 μs ⚪ Unchanged
instantiate_shell_with_init_scripts 24893.23 μs 24539.48 μs -353.75 μs ⚪ Unchanged
parse_bash_completion 2024.24 μs 2035.83 μs 11.59 μs ⚪ Unchanged
parse_sample_script 1.95 μs 1.99 μs 0.04 μs ⚪ Unchanged
run_echo_builtin_command 15.42 μs 14.92 μs -0.50 μs ⚪ Unchanged
tokenize_sample_script 3.46 μs 3.48 μs 0.02 μs ⚪ Unchanged

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/interp.rs 🟢 92.93% 🟢 93.12% 🟢 0.19%
brush-core/src/ioutils.rs 🔴 0% 🔴 39.29% 🟢 39.29%
brush-core/src/openfiles.rs 🟠 61.05% 🟠 61.06% 🟢 0.01%
brush-core/src/sys/unix/commands.rs 🟠 60.87% 🟠 65.38% 🟢 4.51%
brush-core/src/sys/unix/terminal.rs 🟢 80.33% 🟢 80.95% 🟢 0.62%
brush-interactive/src/basic/term_line_reader.rs 🔴 38.46% 🔴 38.34% 🔴 -0.12%
brush-interactive/src/input_backend.rs 🔴 0% 🟠 60% 🟢 60%
brush-interactive/src/interactive_shell.rs 🟢 75.19% 🟠 62.71% 🔴 -12.48%
brush-interactive/src/term_detection.rs 🔴 0% 🟠 57.46% 🟢 57.46%
brush-interactive/src/term_integration.rs 🔴 0% 🔴 46.02% 🟢 46.02%
brush-shell/src/entry.rs 🟢 84.49% 🟢 84.34% 🔴 -0.15%
Overall Coverage 🟢 73.07% 🟢 72.6% 🔴 -0.47%

Minimum allowed coverage is 70%, this run produced 72.6%

Test Summary: bash-completion test suite

Outcome Count Percentage
✅ Pass 1545 73.26
❗️ Error 19 0.90
❌ Fail 191 9.06
⏩ Skip 339 16.07
❎ Expected Fail 13 0.62
✔️ Unexpected Pass 2 0.09
📊 Total 2109 100.00

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment thread brush-interactive/src/term_detection.rs Outdated
Comment thread brush-interactive/src/term_detection.rs
Comment thread brush-interactive/src/term.rs Outdated
Comment thread brush-interactive/src/term.rs Outdated
Comment thread brush-interactive/src/term.rs Outdated
Comment thread brush-interactive/src/term.rs Outdated
Comment thread brush-interactive/src/term_integration.rs
Comment thread brush-interactive/src/term.rs Outdated
Comment thread brush-interactive/src/term_integration.rs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated 10 comments.

Comment thread brush-interactive/src/term_detection.rs Outdated
Comment thread brush-interactive/src/term_integration.rs
Comment thread brush-interactive/src/interactive_shell.rs
Comment thread brush-interactive/src/interactive_shell.rs Outdated
Comment thread brush-interactive/src/term_detection.rs Outdated
Comment thread brush-interactive/src/term_integration.rs Outdated
Comment thread brush-interactive/src/term_integration.rs
Comment thread brush-interactive/src/interactive_shell.rs
Comment thread brush-interactive/src/term_detection.rs Outdated
Comment thread brush-interactive/src/term_detection.rs
@reubeno reubeno marked this pull request as ready for review December 25, 2025 08:51
@reubeno reubeno requested a review from Copilot December 25, 2025 08:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated 8 comments.

Comment thread brush-interactive/src/term_integration.rs
Comment thread brush-interactive/src/term_detection.rs
Comment thread brush-interactive/src/interactive_shell.rs
Comment thread brush-interactive/src/term_integration.rs
Comment thread brush-interactive/src/term_integration.rs Outdated
Comment thread brush-interactive/src/lib.rs
Comment thread brush-interactive/src/options.rs Outdated
Comment thread brush-interactive/src/term_detection.rs
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.

Comment thread brush-interactive/src/term_integration.rs Outdated
Comment thread brush-interactive/src/interactive_shell.rs
Comment thread brush-shell/src/args.rs
@reubeno reubeno changed the title feat: implement experimental shell/terminal integration feat: experimental shell/terminal integration Dec 25, 2025
@reubeno reubeno merged commit 8aa9696 into main Dec 25, 2025
43 checks passed
@reubeno reubeno deleted the shell-integration branch December 25, 2025 11:20
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