Skip to content

Commit

Permalink
term support
Browse files Browse the repository at this point in the history
  • Loading branch information
mosheavni committed Nov 28, 2024
1 parent 51caf49 commit 22fd5f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
1 change: 0 additions & 1 deletion .zsh_plugins.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ zsh-users/zsh-history-substring-search
peterhurford/git-it-on.zsh
hlissner/zsh-autopair
agkozak/zhooks
wez/wezterm path:assets/shell-integration/wezterm.sh
RobSis/zsh-completion-generator

# deferred
Expand Down
16 changes: 3 additions & 13 deletions zsh.d/term-support.zsh
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
function _urlencode() {
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in
%) printf '%%%02X' "'$c" ;;
*) printf "%s" "$c" ;;
esac
done
}

export TERM=wezterm
source /Applications/WezTerm.app/Contents/Resources/wezterm.sh
export TERM=xterm-256color
export WEZTERM_SHELL_INTEGRATION=1

# Emits the control sequence to notify many terminal emulators
# of the cwd
function termsupport_cwd {
printf '\e]7;file://%s%s\e\\' "$HOSTNAME" "$(_urlencode "$PWD")"
print -Pn "\e]0;$(basename $(pwd))\a"
}

# Use a precmd hook instead of a chpwd hook to avoid contaminating output
Expand Down

0 comments on commit 22fd5f9

Please sign in to comment.