staging.inyokaproject.org

zsh durchsucht History nicht nach eingetippten Befehlen

Status: Gelöst | Ubuntu-Version: Ubuntu 24.04 (Noble Numbat)
Antworten |

wüsti

Anmeldungsdatum:
17. September 2024

Beiträge: Zähle...

Die zsh hat die schöne Eigenschaft, die History nach den eingetippten Buchstaben zu durchsuchen. Das funktioniert auf allen meinen Systemen, nur auf einem frisch installierten System nicht.

Die .zshrc habe ich einfach kopiert.

% cat .zshrc                                                         
autoload -Uz compinit promptinit
compinit
promptinit
prompt adam1 blue

zstyle ':completion::complete:*' use-cache 1

HISTSIZE=200
HISTFILE=~/.zsh_history
SAVEHIST=200
bindkey -e
bindkey "^[[2~" yank                    # Insert
bindkey "^[[3~" delete-char             # Del
bindkey "^[[5~" up-line-or-history      # PageUp
bindkey "^[[6~" down-line-or-history    # PageDown
bindkey "^[e"   expand-cmd-path         # C-e for expanding path of typed command.
bindkey "^[[A"  up-line-or-search       # Up arrow for back-history-search.
bindkey "^[[B"  down-line-or-search     # Down arrow for fwd-history-search.
bindkey " "     magic-space             # Do history expansion on space.

bindkey "${terminfo[khome]}" beginning-of-line      # [Home] - Go to beginning of line
bindkey "${terminfo[kend]}"  end-of-line            # [End] - Go to end of line

bindkey "^[[H" beginning-of-line      # [Home] - Go to beginning of line
bindkey "^[[F" end-of-line            # [End] - Go to end of line

bindkey ";5C" emacs-forward-word		#STRG+Pfeil-rechts
bindkey ";5D" emacs-backward-word		#STRG+Pfeil-links

#  Directory in the title bar 
chpwd() {
  [[ -o interactive ]] || return
  case $TERM in
    sun-cmd) print -Pn "\e]l%~\e\\"
      ;;
    *xterm*|rxvt|(dt|k|E)term) print -Pn "\e]2;%~\a"
      ;;
    lxterminal) precmd () {print -Pn "\e]0;%n@%m: %~\a"}
      ;;
  esac
}

export XKB_DEFAULT_LAYOUT=de
export GTK2_RC_FILES="/usr/share/gtk-2.0/gtkrc"

Das Zeichen für die Pfeiltaste nach oben unterscheidet sich nicht.

% cat
^[[A

Die History:

% cat .zsh_history
df -h
du -h
bindkey -e
ls
cat .zsh_history
ls
cat .zsh_history
exit

Gebe ich nun "d" und dann "Pfeil oben" ein erscheint

exit

es sollte aber

du -h

erscheinen.

% zsh --version
zsh 5.9 (x86_64-ubuntu-linux-gnu)

Was ist falsch?

Vielen Dank! Wüsti

Moderiert von rklm:

Verschoben ins passende Forum

wüsti

(Themenstarter)

Anmeldungsdatum:
17. September 2024

Beiträge: Zähle...

Die Lösung war recht einfach:

Ubuntu liefert eine Configdatei in /etc/zsh aus, die die Tastenkombinationen definiert.

Nachdem ich alle Dateien unter /etc/zsh gelöscht habe, funktioniert die zsh problemlos.

Antworten |