mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-22 04:51:12 +02:00
Update update_terminalapp_cwd to urlencode the hostname
Apple's Terminal doesn't open a new tab in your current directory if your hostname has UTF-8 characters in it. Percent encoding the host in addition to the path in update_terminalapp_cwd appears to solve this issue.
This commit is contained in:
parent
d848c94804
commit
9e59a9b7b5
1 changed files with 5 additions and 1 deletions
|
|
@ -93,9 +93,13 @@ if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then
|
||||||
# Percent-encode the pathname.
|
# Percent-encode the pathname.
|
||||||
local URL_PATH="$(omz_urlencode -P $PWD)"
|
local URL_PATH="$(omz_urlencode -P $PWD)"
|
||||||
[[ $? != 0 ]] && return 1
|
[[ $? != 0 ]] && return 1
|
||||||
|
|
||||||
|
# Percent-encode the hostname.
|
||||||
|
local URL_HOST="$(omz_urlencode -P $HOST)"
|
||||||
|
[[ $? != 0 ]] && return 1
|
||||||
|
|
||||||
# Undocumented Terminal.app-specific control sequence
|
# Undocumented Terminal.app-specific control sequence
|
||||||
printf '\e]7;%s\a' "file://$HOST$URL_PATH"
|
printf '\e]7;%s\a' "file://$URL_HOST$URL_PATH"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Use a precmd hook instead of a chpwd hook to avoid contaminating output
|
# Use a precmd hook instead of a chpwd hook to avoid contaminating output
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue