Просмотр исходного кода

~/.zshrc: Better escaping for the last-cmd prompt.

I think `!` is only used for history expansion, something I don't use
often and it is replaced by the command in question anyway. So that
should be ok?
Lucas Stadler лет назад: 12
Родитель
Сommit
59e30e3f5a
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      .zshrc

+ 1 - 1
.zshrc

35
	user="%{$fg[red]%}%n%{$reset_color%}"
35
	user="%{$fg[red]%}%n%{$reset_color%}"
36
	dir="%{$fg[cyan]%}%~%{$reset_color%}"
36
	dir="%{$fg[cyan]%}%~%{$reset_color%}"
37
	lastcmd="$history[$(($HISTCMD-1))]"
37
	lastcmd="$history[$(($HISTCMD-1))]"
38
	lastcmd_witherror="%(?.$lastcmd.%B$lastcmd%b)"
38
	lastcmd_witherror="%(?!$lastcmd!%B$lastcmd%b)"
39
	PROMPT="$user in $dir@$(repo_branch) $lastcmd_witherror
39
	PROMPT="$user in $dir@$(repo_branch) $lastcmd_witherror
40
$(repo_char) $ "
40
$(repo_char) $ "
41
	RPROMPT="%D{%Y-%m-%d} %{$fg[red]%}%t%{$reset_color%}"
41
	RPROMPT="%D{%Y-%m-%d} %{$fg[red]%}%t%{$reset_color%}"