Skip to content

feat: Xonsh shell integration add support for 'run recent command' with Xonsh#289481

Open
wajdiJomaa wants to merge 9 commits into
microsoft:mainfrom
wajdiJomaa:xonsh-shell-integration
Open

feat: Xonsh shell integration add support for 'run recent command' with Xonsh#289481
wajdiJomaa wants to merge 9 commits into
microsoft:mainfrom
wajdiJomaa:xonsh-shell-integration

Conversation

@wajdiJomaa

Copy link
Copy Markdown

As suggested in #284044 #284044 (comment):

the main goal of this pull request is to integrate Xonsh shell in vscode in order to get a list of recent commands for current

and previous session when running 'run recent command'

Screenshot from 2026-01-21 22-28-10

@vs-code-engineering

vs-code-engineering Bot commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@Tyriar

Matched files:

  • src/vs/platform/terminal/node/terminalEnvironment.ts
  • src/vs/platform/terminal/node/terminalProcess.ts

@wajdiJomaa

wajdiJomaa commented Jan 21, 2026

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@wajdiJomaa

Copy link
Copy Markdown
Author

Hi @Tyriar, Can you please check this PR? I would like to hear your feedback, thanks

Comment thread src/vs/platform/terminal/node/terminalEnvironment.ts
@anthonykim1

anthonykim1 commented Feb 1, 2026

Copy link
Copy Markdown
Contributor
Screenshot 2026-02-01 at 2 47 18 PM

I think there's a bug somewhere where xonsh shell type is getting overwritten with Python. Even though its Python powered shell I was expecting xonsh. Maybe the order of shell type would make a difference

Comment thread src/vs/workbench/contrib/terminal/common/scripts/shellIntegration-xonsh.xsh Outdated
Comment thread src/vs/workbench/contrib/terminal/common/scripts/shellIntegration-xonsh.xsh Outdated
- add support for xonsh login shell variant
- add support for cwd sequence
@anki-code

anki-code commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

Just want to add some graphical concepts for news

image image

@wajdiJomaa

wajdiJomaa commented Feb 5, 2026

Copy link
Copy Markdown
Author

Hi @anthonykim1 , added a new commit with the following edits:

  • add support for cwd sequence inside shell integration script
  • add support for login shell
  • fix shell type bug

@wajdiJomaa

Copy link
Copy Markdown
Author

Hi @anthonykim1, I would like to get your feedback about the changes that I made. could you please review the changes?

@anki-code

Copy link
Copy Markdown
Contributor

Any news here?

@flavius

flavius commented Jul 4, 2026

Copy link
Copy Markdown

Why is the communication on this so terrible? @anthonykim1 - ownership?

Copilot AI review requested due to automatic review settings July 16, 2026 04:53
@anthonykim1 anthonykim1 added this to the 1.130.0 milestone Jul 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds Xonsh shell integration so Run Recent Command can access current and previous session commands.

Changes:

  • Adds Xonsh OSC 633 integration hooks.
  • Injects the integration script and detects Xonsh processes.
  • Excludes .xsh files from copyright filtering.
Show a summary per file
File Description
shellIntegration-xonsh.xsh Implements Xonsh shell integration.
terminalProcess.ts Detects Xonsh process titles.
terminalEnvironment.ts Configures Xonsh integration injection.
build/filters.ts Adds .xsh copyright-filter handling.

Review details

  • Files reviewed: 4/4 changed files
  • Comments generated: 7
  • Review effort level: Medium

Comment on lines +357 to +358
shellIntegrationArgs.set(ShellIntegrationExecutable.Xonsh, ['-i', '--rc', '{0}/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-xonsh.xsh']);
shellIntegrationArgs.set(ShellIntegrationExecutable.XonshLogin, ['-l', '-i', '--rc', '{0}/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-xonsh.xsh']);
Comment on lines +89 to +90
self.write_osc(f'633;C')
self.write_osc(f'633;E;{escaped_cmd};{self._vscode_nonce}')

def __init__(self):
if 'VSCODE_INJECTION' in __xonsh__.env:
self._vscode_nonce = __xonsh__.env.get('VSCODE_NONCE', '')
});
return { type, newArgs, envMixin, filesToCopy };
}
case 'xonsh': {
Comment on lines +15 to +19
self.vsc_apply_xonshrc()
self.vsc_prompt_fields()
self.add_vsc_to_prompt()
self.add_vsc_events()
__xonsh__.env['VSCODE_SHELL_INTEGRATION'] = '1'
Comment on lines +277 to +281
case 'xonsh': {
if (!originalArgs || originalArgs.length === 0) {
newArgs = shellIntegrationArgs.get(ShellIntegrationExecutable.Xonsh);
} else if (areXonshLoginArgs(originalArgs)) {
newArgs = shellIntegrationArgs.get(ShellIntegrationExecutable.XonshLogin);
self.vsc_apply_xonshrc()
self.vsc_prompt_fields()
self.add_vsc_to_prompt()
self.add_vsc_events()
@anthonykim1

anthonykim1 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@wajdiJomaa Thanks for waiting. Generally looks good to me.

Manually testing however, I'm still seeing "python" as shell type and history from python for run recent command on my mac along with no decorations 🧐

Screenshot 2026-07-15 at 10 23 42 PM Screenshot 2026-07-15 at 10 23 35 PM

I'd check how we handled this sort of issue for python, or other shells.

Also would recommend taking a look at some of the copilot comments.

@anthonykim1
anthonykim1 force-pushed the xonsh-shell-integration branch from f5ddf4f to 3ea07f3 Compare July 16, 2026 06:11
@rzhao271 rzhao271 modified the milestones: 1.130.0, 1.131.0 Jul 22, 2026
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.

6 participants