SHA256
1
0
forked from pool/tcsh

Accepting request 910148 from shells

- Key-binding: support also other variants of terminals like xterm-256color

OBS-URL: https://build.opensuse.org/request/show/910148
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/tcsh?expand=0&rev=78
This commit is contained in:
Dominique Leuenberger 2021-08-05 18:47:57 +00:00 committed by Git OBS Bridge
commit f768e44d56
2 changed files with 20 additions and 15 deletions

View File

@ -49,7 +49,7 @@ bindkey "\2333~" delete-char
bindkey "\2334~" end-of-line bindkey "\2334~" end-of-line
bindkey "\2335~" history-search-backward bindkey "\2335~" history-search-backward
bindkey "\2336~" history-search-forward bindkey "\2336~" history-search-forward
if ( "$TERM" == "xterm" ) then if ( "$TERM" =~ xterm* ) then
bindkey "^[[2;2~" yank bindkey "^[[2;2~" yank
bindkey "^[[3;2~" delete-char bindkey "^[[3;2~" delete-char
bindkey "^[[5;2~" history-search-backward bindkey "^[[5;2~" history-search-backward
@ -122,7 +122,7 @@ bindkey "^C^M[A" up-history
bindkey "^C^M[B" down-history bindkey "^C^M[B" down-history
bindkey "^C^[[D" backward-char bindkey "^C^[[D" backward-char
# #
if ( "$TERM" == "xterm" ) then if ( "$TERM" =~ xterm* ) then
bindkey -c "^[[E" "source /etc/csh.cshrc" bindkey -c "^[[E" "source /etc/csh.cshrc"
bindkey -c "^[[1;2E" "source /etc/csh.cshrc" bindkey -c "^[[1;2E" "source /etc/csh.cshrc"
bindkey -c "^[[1;3E" "source /etc/csh.cshrc" bindkey -c "^[[1;3E" "source /etc/csh.cshrc"
@ -218,7 +218,7 @@ endif
# #
bindkey "^?" backward-delete-char bindkey "^?" backward-delete-char
bindkey "^H" backward-delete-char bindkey "^H" backward-delete-char
if ( "$TERM" == "xterm" ) then if ( "$TERM" =~ xterm* ) then
# #
# XTerm in UTF-8 mode # XTerm in UTF-8 mode
# #
@ -228,7 +228,7 @@ endif
# #
# Home and End # Home and End
# #
if ( "$TERM" == "xterm" ) then if ( "$TERM" =~ xterm* ) then
# #
# Normal keypad and cursor of xterm # Normal keypad and cursor of xterm
# #
@ -276,7 +276,7 @@ if ( "$TERM" == "xterm" ) then
bindkey "^[O5H" beginning-of-line bindkey "^[O5H" beginning-of-line
bindkey "^[O5F" end-of-line bindkey "^[O5F" end-of-line
else else
if ( "$TERM" == "kvt" ) then if ( "$TERM" =~ kvt* ) then
bindkey "^[[1~" history-search-backward bindkey "^[[1~" history-search-backward
bindkey "^[[4~" set-mark-command bindkey "^[[4~" set-mark-command
bindkey "^[OH" beginning-of-line bindkey "^[OH" beginning-of-line
@ -291,7 +291,7 @@ endif
# #
# Application keypad and cursor of xterm # Application keypad and cursor of xterm
# #
if ( "$TERM" == "xterm" ) then if ( "$TERM" =~ xterm* ) then
bindkey "^[OD" backward-char bindkey "^[OD" backward-char
bindkey "^[OC" forward-char bindkey "^[OC" forward-char
bindkey "^[OA" up-history bindkey "^[OA" up-history
@ -388,7 +388,7 @@ if ( "$TERM" == "xterm" ) then
bindkey "^[O1;8R" undefined-key bindkey "^[O1;8R" undefined-key
bindkey "^[O1;8S" kill-line bindkey "^[O1;8S" kill-line
endif endif
if ( "$TERM" == "gnome" ) then if ( "$TERM" =~ gnome* ) then
# or gnome terminal F1 - F4 # or gnome terminal F1 - F4
bindkey -s "^[OP" "^[" bindkey -s "^[OP" "^["
bindkey "^[OQ" vi-undo bindkey "^[OQ" vi-undo
@ -398,7 +398,7 @@ endif
# #
# Function keys F1 - F12 # Function keys F1 - F12
# #
if ( "$TERM" == "linux" ) then if ( "$TERM" =~ linux* ) then
# #
# On console the first five function keys # On console the first five function keys
# #
@ -453,7 +453,7 @@ bindkey "\23333~" undefined-key
bindkey "\23334~" undefined-key bindkey "\23334~" undefined-key
bindkey "\23335~" undefined-key bindkey "\23335~" undefined-key
bindkey "\23336~" undefined-key bindkey "\23336~" undefined-key
if ( "$TERM" == "xterm" ) then if ( "$TERM" =~ xterm* ) then
bindkey "^[[1;2P" undefined-key bindkey "^[[1;2P" undefined-key
bindkey "^[[1;2Q" undefined-key bindkey "^[[1;2Q" undefined-key
bindkey "^[[1;2R" undefined-key bindkey "^[[1;2R" undefined-key
@ -540,7 +540,7 @@ if ( "$TERM" == "xterm" ) then
bindkey "^[[24;8~" undefined-key bindkey "^[[24;8~" undefined-key
endif endif
# #
if ( "$TERM" == "xterm" ) then if ( "$TERM" =~ xterm* ) then
# #
# Application keypad and cursor of xterm # Application keypad and cursor of xterm
# with NumLock ON # with NumLock ON
@ -596,11 +596,11 @@ if ( "$TERM" == "xterm" ) then
bindkey "^[9" history-search-backward bindkey "^[9" history-search-backward
endif endif
# #
if ( "$TERM" == "kterm" ) then if ( "$TERM" =~ kterm* ) then
bindkey "^[[\000" undefined-key bindkey "^[[\000" undefined-key
endif endif
# #
if ( "$TERM" == "mlterm" ) then if ( "$TERM" =~ mlterm* ) then
bindkey -c "^[[E" "source /etc/csh.cshrc" bindkey -c "^[[E" "source /etc/csh.cshrc"
bindkey "^[OH" beginning-of-line bindkey "^[OH" beginning-of-line
bindkey "^[OF" end-of-line bindkey "^[OF" end-of-line
@ -731,7 +731,7 @@ if ( "$TERM" == "mlterm" ) then
bindkey "^[9" history-search-backward bindkey "^[9" history-search-backward
endif endif
# #
if ( "$TERM" == "rxvt-unicode" || $TERM == "rxvt-unicode-256color" ) then if ( "$TERM" =~ rxvt-unicode* ) then
bindkey '^[[23$' undefined-key bindkey '^[[23$' undefined-key
bindkey '^[[24$' undefined-key bindkey '^[[24$' undefined-key
bindkey "^[[11\^" undefined-key bindkey "^[[11\^" undefined-key
@ -825,7 +825,7 @@ if ( "$CSHEDIT" == "emacs" ) then
# #
# ... xterm application cursor # ... xterm application cursor
# #
if ( "$TERM" == "xterm" ) then if ( "$TERM" =~ xterm* ) then
bindkey "^[^[OD" backward-word bindkey "^[^[OD" backward-word
bindkey "^[^[OC" forward-word bindkey "^[^[OC" forward-word
bindkey "^[^[OA" up-history bindkey "^[^[OA" up-history
@ -850,7 +850,7 @@ endif
# #
# Screen # Screen
# #
if ( "$TERM" == "screen" ) then if ( "$TERM" =~ screen* ) then
bindkey "\e[1;2D" backward-word bindkey "\e[1;2D" backward-word
bindkey "\e[1;2C" forward-word bindkey "\e[1;2C" forward-word
bindkey "\e[1;2A" up-history bindkey "\e[1;2A" up-history

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Aug 4 12:24:25 UTC 2021 - Dr. Werner Fink <werner@suse.de>
- Key-binding: support also other variants of terminals like xterm-256color
------------------------------------------------------------------- -------------------------------------------------------------------
Fri May 28 08:59:28 UTC 2021 - Dr. Werner Fink <werner@suse.de> Fri May 28 08:59:28 UTC 2021 - Dr. Werner Fink <werner@suse.de>