8000 Use the builtin local command in shell integration scripts · githubnext/vscode@6d8cfe1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6d8cfe1

Browse files
committed
Use the builtin local command in shell integration scripts
1 parent 02e7848 commit 6d8cfe1

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ __vsc_escape_value() {
112112
fi
113113

114114
# Process text byte by byte, not by codepoint.
115-
local -r LC_ALL=C
116-
local -r str="${1}"
117-
local -ir len="${#str}"
115+
builtin local -r LC_ALL=C
116+
builtin local -r str="${1}"
117+
builtin local -ir len="${#str}"
118118

119-
local -i i
120-
local -i val
121-
local byte
122-
local token
123-
local out=''
119+
builtin local -i i
120+
builtin local -i val
121+
builtin local byte
122+
builtin local token
123+
builtin local out=''
124124

125125
for (( i=0; i < "${#str}"; ++i )); do
126126
# Escape backslashes, semi-colons specially, then special ASCII chars below space (0x20).
@@ -326,7 +326,7 @@ __vsc_prompt_cmd_original() {
326326
__vsc_restore_exit_code "${__vsc_status}"
327327
# Evaluate the original PROMPT_COMMAND similarly to how bash would normally
328328
# See https://unix.stackexchange.com/a/672843 for technique
329-
local cmd
329+
builtin local cmd
330330
for cmd in "${__vsc_original_prompt_command[@]}"; do
331331
eval "${cmd:-}"
332332
done

src/vs/workbench/contrib/terminal/browser/media/shellIntegration-rc.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ __vsc_update_prompt() {
159159
}
160160

161161
__vsc_precmd() {
162-
local __vsc_status="$?"
162+
builtin local __vsc_status="$?"
163163
if [ -z "${__vsc_in_command_execution-}" ]; then
164164
# not in command execution
165165
__vsc_command_output_start

0 commit comments

Comments
 (0)
0