Przeglądaj źródła

~/.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 lat temu
rodzic
commit
59e30e3f5a
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      .zshrc

+ 1 - 1
.zshrc

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