mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Merge pull request #215485 from microsoft/tyriar/stable
Disable pwsh/bash prompt reporting when on stable
This commit is contained in:
commit
1c74595688
|
@ -157,6 +157,7 @@ export function getShellIntegrationInjection(
|
|||
}
|
||||
newArgs = [...newArgs]; // Shallow clone the array to avoid setting the default array
|
||||
newArgs[newArgs.length - 1] = format(newArgs[newArgs.length - 1], appRoot, '');
|
||||
envMixin['VSCODE_STABLE'] = productService.quality === 'stable' ? '1' : '0';
|
||||
if (options.shellIntegration.suggestEnabled) {
|
||||
envMixin['VSCODE_SUGGEST'] = '1';
|
||||
}
|
||||
|
@ -174,6 +175,7 @@ export function getShellIntegrationInjection(
|
|||
}
|
||||
newArgs = [...newArgs]; // Shallow clone the array to avoid setting the default array
|
||||
newArgs[newArgs.length - 1] = format(newArgs[newArgs.length - 1], appRoot);
|
||||
envMixin['VSCODE_STABLE'] = productService.quality === 'stable' ? '1' : '0';
|
||||
return { newArgs, envMixin };
|
||||
}
|
||||
logService.warn(`Shell integration cannot be enabled for executable "${shellLaunchConfig.executable}" and args`, shellLaunchConfig.args);
|
||||
|
@ -195,6 +197,7 @@ export function getShellIntegrationInjection(
|
|||
}
|
||||
newArgs = [...newArgs]; // Shallow clone the array to avoid setting the default array
|
||||
newArgs[newArgs.length - 1] = format(newArgs[newArgs.length - 1], appRoot);
|
||||
envMixin['VSCODE_STABLE'] = productService.quality === 'stable' ? '1' : '0';
|
||||
return { newArgs, envMixin };
|
||||
}
|
||||
case 'fish': {
|
||||
|
@ -220,6 +223,7 @@ export function getShellIntegrationInjection(
|
|||
}
|
||||
newArgs = [...newArgs]; // Shallow clone the array to avoid setting the default array
|
||||
newArgs[newArgs.length - 1] = format(newArgs[newArgs.length - 1], appRoot, '');
|
||||
envMixin['VSCODE_STABLE'] = productService.quality === 'stable' ? '1' : '0';
|
||||
return { newArgs, envMixin };
|
||||
}
|
||||
case 'zsh': {
|
||||
|
|
|
@ -186,7 +186,8 @@ suite('platform - terminalEnvironment', () => {
|
|||
`${repoRoot}/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh`
|
||||
],
|
||||
envMixin: {
|
||||
VSCODE_INJECTION: '1'
|
||||
VSCODE_INJECTION: '1',
|
||||
VSCODE_STABLE: '0'
|
||||
}
|
||||
});
|
||||
deepStrictEqual(getShellIntegrationInjection({ executable: 'bash', args: [] }, enabledProcessOptions, defaultEnvironment, logService, productService), enabledExpectedResult);
|
||||
|
@ -201,7 +202,8 @@ suite('platform - terminalEnvironment', () => {
|
|||
],
|
||||
envMixin: {
|
||||
VSCODE_INJECTION: '1',
|
||||
VSCODE_SHELL_LOGIN: '1'
|
||||
VSCODE_SHELL_LOGIN: '1',
|
||||
VSCODE_STABLE: '0'
|
||||
}
|
||||
});
|
||||
test('when array', () => {
|
||||
|
|
|
@ -170,6 +170,10 @@ __vsc_current_command=""
|
|||
__vsc_nonce="$VSCODE_NONCE"
|
||||
unset VSCODE_NONCE
|
||||
|
||||
# Some features should only work in Insiders
|
||||
__vsc_stable="$VSCODE_STABLE"
|
||||
unset VSCODE_STABLE
|
||||
|
||||
# Report continuation prompt
|
||||
builtin printf "\e]633;P;ContinuationPrompt=$(echo "$PS2" | sed 's/\x1b/\\\\x1b/g')\a"
|
||||
|
||||
|
@ -252,7 +256,10 @@ __vsc_update_prompt() {
|
|||
__vsc_precmd() {
|
||||
__vsc_command_complete "$__vsc_status"
|
||||
__vsc_current_command=""
|
||||
__vsc_report_prompt
|
||||
# Report prompt is a work in progress, currently encoding is too slow
|
||||
if [ "$__vsc_stable" = "0" ]; then
|
||||
__vsc_report_prompt
|
||||
fi
|
||||
__vsc_first_prompt=1
|
||||
__vsc_update_prompt
|
||||
}
|
||||
|
|
|
@ -21,6 +21,9 @@ $Global:__LastHistoryId = -1
|
|||
$Nonce = $env:VSCODE_NONCE
|
||||
$env:VSCODE_NONCE = $null
|
||||
|
||||
$isStable = $env:VSCODE_STABLE
|
||||
$env:VSCODE_STABLE = $null
|
||||
|
||||
$osVersion = [System.Environment]::OSVersion.Version
|
||||
$isWindows10 = $IsWindows -and $osVersion.Major -eq 10 -and $osVersion.Minor -eq 0 -and $osVersion.Build -lt 22000
|
||||
|
||||
|
@ -95,7 +98,9 @@ function Global:Prompt() {
|
|||
|
||||
# Prompt
|
||||
# OSC 633 ; <Property>=<Value> ST
|
||||
$Result += "$([char]0x1b)]633;P;Prompt=$(__VSCode-Escape-Value $OriginalPrompt)`a"
|
||||
if ($isStable -eq "1") {
|
||||
$Result += "$([char]0x1b)]633;P;Prompt=$(__VSCode-Escape-Value $OriginalPrompt)`a"
|
||||
}
|
||||
|
||||
# Write command started
|
||||
$Result += "$([char]0x1b)]633;B`a"
|
||||
|
|
Loading…
Reference in a new issue