Enable vterm directory and prompt tracking
This commit is contained in:
parent
d17a912bb3
commit
41dbda027d
2 changed files with 20 additions and 3 deletions
19
nix/config/zsh/zshrc
Normal file
19
nix/config/zsh/zshrc
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||
|
||||
vterm_printf() {
|
||||
if [ -n "$TMUX" ] && ([ "${TERM%%-*}" = "tmux" ] || [ "${TERM%%-*}" = "screen" ]); then
|
||||
# Tell tmux to pass the escape sequences through
|
||||
printf "\ePtmux;\e\e]%s\007\e\\" "$1"
|
||||
elif [ "${TERM%%-*}" = "screen" ]; then
|
||||
# GNU screen (screen, screen-256color, screen-256color-bce)
|
||||
printf "\eP\e]%s\007\e\\" "$1"
|
||||
else
|
||||
printf "\e]%s\e\\" "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
vterm_prompt_end() {
|
||||
vterm_printf "51;A$(whoami)@$(hostname):$(pwd)"
|
||||
}
|
||||
setopt PROMPT_SUBST
|
||||
PROMPT=$PROMPT'%{$(vterm_prompt_end)%}'
|
||||
|
|
@ -173,9 +173,7 @@
|
|||
enable = true;
|
||||
enableCompletion = true;
|
||||
enableAutosuggestions = true;
|
||||
initExtra = ''
|
||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||
'';
|
||||
initExtra = builtins.readFile ../config/zsh/zshrc;
|
||||
syntaxHighlighting.enable = true;
|
||||
shellAliases = {
|
||||
ls = "ls --color=auto -F";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue