feat: Xonsh shell integration add support for 'run recent command' with Xonsh#289481
feat: Xonsh shell integration add support for 'run recent command' with Xonsh#289481wajdiJomaa wants to merge 9 commits into
Conversation
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @TyriarMatched files:
|
|
@microsoft-github-policy-service agree |
|
Hi @Tyriar, Can you please check this PR? I would like to hear your feedback, thanks |
- add support for xonsh login shell variant - add support for cwd sequence
|
Hi @anthonykim1 , added a new commit with the following edits:
|
|
Hi @anthonykim1, I would like to get your feedback about the changes that I made. could you please review the changes? |
|
Any news here? |
|
Why is the communication on this so terrible? @anthonykim1 - ownership? |
There was a problem hiding this comment.
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
.xshfiles 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
| 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']); |
| 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': { |
| self.vsc_apply_xonshrc() | ||
| self.vsc_prompt_fields() | ||
| self.add_vsc_to_prompt() | ||
| self.add_vsc_events() | ||
| __xonsh__.env['VSCODE_SHELL_INTEGRATION'] = '1' |
| 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() |
|
@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 🧐
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. |
f5ddf4f to
3ea07f3
Compare





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'