Allow 8bit key escape control sequences for XTerm
OBS-URL: https://build.opensuse.org/package/show/shells/tcsh?expand=0&rev=70
This commit is contained in:
parent
5349494106
commit
bf532067bf
139
bindkey.tcsh
139
bindkey.tcsh
@ -31,6 +31,19 @@ bindkey "^[[3~" delete-char
|
||||
bindkey "^[[4~" end-of-line
|
||||
bindkey "^[[5~" history-search-backward
|
||||
bindkey "^[[6~" history-search-forward
|
||||
bindkey "^M[1~" beginning-of-line
|
||||
bindkey "^M[2~" yank
|
||||
bindkey "^M[3~" delete-char
|
||||
bindkey "^M[4~" end-of-line
|
||||
bindkey "^M[5~" history-search-backward
|
||||
bindkey "^M[6~" history-search-forward
|
||||
bindkey -r "\233"
|
||||
bindkey "\2331~" beginning-of-line
|
||||
bindkey "\2332~" yank
|
||||
bindkey "\2333~" delete-char
|
||||
bindkey "\2334~" end-of-line
|
||||
bindkey "\2335~" history-search-backward
|
||||
bindkey "\2336~" history-search-forward
|
||||
if ( "$TERM" == "xterm" ) then
|
||||
bindkey "^[[2;2~" yank
|
||||
bindkey "^[[3;2~" delete-char
|
||||
@ -65,6 +78,45 @@ bindkey "^[[C" forward-char
|
||||
bindkey "^[[D" backward-char
|
||||
bindkey "^[[A" up-history
|
||||
bindkey "^[[B" down-history
|
||||
bindkey -r "\217"
|
||||
bindkey "\217C" forward-char
|
||||
bindkey "\217D" backward-char
|
||||
bindkey "\217A" up-history
|
||||
bindkey "\217B" down-history
|
||||
bindkey "\233C" forward-char
|
||||
bindkey "\233D" backward-char
|
||||
bindkey "\233A" up-history
|
||||
bindkey "\233B" down-history
|
||||
#
|
||||
# Cursor keys in keypad mode
|
||||
#
|
||||
bindkey "^C[OC" forward-char
|
||||
bindkey "^C[OD" backward-char
|
||||
bindkey "^C[OA" up-history
|
||||
bindkey "^C[OB" down-history
|
||||
#
|
||||
# Cursor keys in ANSI mode
|
||||
#
|
||||
bindkey "^C[[C" forward-char
|
||||
bindkey "^C[[D" backward-char
|
||||
bindkey "^C[[A" up-history
|
||||
bindkey "^C[[B" down-history
|
||||
#
|
||||
# Cursor keys in 8 bit keypad mode
|
||||
#
|
||||
bindkey "^C^MOC" forward-char
|
||||
bindkey "^C^MOD" backward-char
|
||||
bindkey "^C^MOA" up-history
|
||||
bindkey "^C^MOB" down-history
|
||||
#
|
||||
# Cursor keys in 8 bit ANSI mode
|
||||
#
|
||||
bindkey "^C^M[C" forward-char
|
||||
bindkey "^C^M[D" backward-char
|
||||
bindkey "^C^M[A" up-history
|
||||
bindkey "^C^M[B" down-history
|
||||
bindkey "^C^[[D" backward-char
|
||||
#
|
||||
if ( "$TERM" == "xterm" ) then
|
||||
bindkey -c "^[[E" "source /etc/csh.cshrc"
|
||||
bindkey -c "^[[1;2E" "source /etc/csh.cshrc"
|
||||
@ -110,6 +162,43 @@ if ( "$TERM" == "xterm" ) then
|
||||
bindkey "^[[1;8D" backward-word
|
||||
bindkey "^[[1;8A" history-search-backward
|
||||
bindkey "^[[1;8B" history-search-forward
|
||||
|
||||
bindkey "\2332C" forward-word
|
||||
bindkey "\2332D" backward-word
|
||||
bindkey "\2332A" history-search-backward
|
||||
bindkey "\2332B" history-search-forward
|
||||
bindkey "\2331;2C" forward-word
|
||||
bindkey "\2331;2D" backward-word
|
||||
bindkey "\2331;2A" history-search-backward
|
||||
bindkey "\2331;2B" history-search-forward
|
||||
bindkey "\2331;3C" forward-word
|
||||
bindkey "\2331;3D" backward-word
|
||||
bindkey "\2331;3A" history-search-backward
|
||||
bindkey "\2331;3B" history-search-forward
|
||||
bindkey "\2331;4C" forward-word
|
||||
bindkey "\2331;4D" backward-word
|
||||
bindkey "\2331;4A" history-search-backward
|
||||
bindkey "\2331;4B" history-search-forward
|
||||
bindkey "\2335C" forward-word
|
||||
bindkey "\2335D" backward-word
|
||||
bindkey "\2335A" history-search-backward
|
||||
bindkey "\2335B" history-search-forward
|
||||
bindkey "\2331;5C" forward-word
|
||||
bindkey "\2331;5D" backward-word
|
||||
bindkey "\2331;5A" history-search-backward
|
||||
bindkey "\2331;5B" history-search-forward
|
||||
bindkey "\2331;6C" forward-word
|
||||
bindkey "\2331;6D" backward-word
|
||||
bindkey "\2331;6A" history-search-backward
|
||||
bindkey "\2331;6B" history-search-forward
|
||||
bindkey "\2331;7C" forward-word
|
||||
bindkey "\2331;7D" backward-word
|
||||
bindkey "\2331;7A" history-search-backward
|
||||
bindkey "\2331;7B" history-search-forward
|
||||
bindkey "\2331;8C" forward-word
|
||||
bindkey "\2331;8D" backward-word
|
||||
bindkey "\2331;8A" history-search-backward
|
||||
bindkey "\2331;8B" history-search-forward
|
||||
else
|
||||
bindkey -c "^[[G" "source /etc/csh.cshrc"
|
||||
endif
|
||||
@ -156,6 +245,20 @@ if ( "$TERM" == "xterm" ) then
|
||||
bindkey "^[[1;7F" end-of-line
|
||||
bindkey "^[[1;8H" beginning-of-line
|
||||
bindkey "^[[1;8F" end-of-line
|
||||
bindkey "\2331;2H" beginning-of-line
|
||||
bindkey "\2331;2F" end-of-line
|
||||
bindkey "\2331;3H" beginning-of-line
|
||||
bindkey "\2331;3F" end-of-line
|
||||
bindkey "\2331;4H" beginning-of-line
|
||||
bindkey "\2331;4F" end-of-line
|
||||
bindkey "\2331;5H" beginning-of-line
|
||||
bindkey "\2331;5F" end-of-line
|
||||
bindkey "\2331;6H" beginning-of-line
|
||||
bindkey "\2331;6F" end-of-line
|
||||
bindkey "\2331;7H" beginning-of-line
|
||||
bindkey "\2331;7F" end-of-line
|
||||
bindkey "\2331;8H" beginning-of-line
|
||||
bindkey "\2331;8F" end-of-line
|
||||
bindkey "^[[2H" beginning-of-line
|
||||
bindkey "^[[2F" end-of-line
|
||||
bindkey "^[[5H" beginning-of-line
|
||||
@ -328,6 +431,23 @@ bindkey "^[[33~" undefined-key
|
||||
bindkey "^[[34~" undefined-key
|
||||
bindkey "^[[35~" undefined-key
|
||||
bindkey "^[[36~" undefined-key
|
||||
bindkey "\23317~" undefined-key
|
||||
bindkey "\23318~" undefined-key
|
||||
bindkey "\23319~" undefined-key
|
||||
bindkey "\23320~" undefined-key
|
||||
bindkey "\23321~" undefined-key
|
||||
bindkey "\23323~" undefined-key
|
||||
bindkey "\23324~" undefined-key
|
||||
bindkey "\23325~" undefined-key
|
||||
bindkey "\23326~" undefined-key
|
||||
bindkey "\23328~" undefined-key
|
||||
bindkey "\23329~" undefined-key
|
||||
bindkey "\23331~" undefined-key
|
||||
bindkey "\23332~" undefined-key
|
||||
bindkey "\23333~" undefined-key
|
||||
bindkey "\23334~" undefined-key
|
||||
bindkey "\23335~" undefined-key
|
||||
bindkey "\23336~" undefined-key
|
||||
if ( "$TERM" == "xterm" ) then
|
||||
bindkey "^[[1;2P" undefined-key
|
||||
bindkey "^[[1;2Q" undefined-key
|
||||
@ -439,6 +559,25 @@ if ( "$TERM" == "xterm" ) then
|
||||
bindkey -s "^[Ow" "7"
|
||||
bindkey -s "^[Ox" "8"
|
||||
bindkey -s "^[Oy" "9"
|
||||
# Operators
|
||||
bindkey -s "\217o" "/"
|
||||
bindkey -s "\217j" "*"
|
||||
bindkey -s "\217m" "-"
|
||||
bindkey -s "\217k" "+"
|
||||
bindkey -s "\217l" ","
|
||||
bindkey "\217M" newline
|
||||
bindkey -s "\217n" "."
|
||||
# Numbers
|
||||
bindkey -s "\217p" "0"
|
||||
bindkey -s "\217q" "1"
|
||||
bindkey -s "\217r" "2"
|
||||
bindkey -s "\217s" "3"
|
||||
bindkey -s "\217t" "4"
|
||||
bindkey -s "\217u" "5"
|
||||
bindkey -s "\217v" "6"
|
||||
bindkey -s "\217w" "7"
|
||||
bindkey -s "\217x" "8"
|
||||
bindkey -s "\217y" "9"
|
||||
# Shift+Alt+KP_<0...9> of konsole
|
||||
bindkey "^[0" yank
|
||||
bindkey "^[1" end-of-line
|
||||
|
32
tcsh-6.20.00-8bit-cmdkeys.patch
Normal file
32
tcsh-6.20.00-8bit-cmdkeys.patch
Normal file
@ -0,0 +1,32 @@
|
||||
From dd0f2cbde7ed7ccbcc420613992d6876302b8b0b Mon Sep 17 00:00:00 2001
|
||||
From: Werner Fink <werner@suse.de>
|
||||
Date: Fri, 28 Apr 2017 09:21:18 +0200
|
||||
Subject: [PATCH] Do not convert current used control bytes into wide characters
|
||||
|
||||
Signed-off-by: Werner Fink <werner@suse.de>
|
||||
---
|
||||
ed.inputl.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
--- ed.inputl.c
|
||||
+++ ed.inputl.c 2017-04-28 07:12:15.777368417 +0000
|
||||
@@ -699,7 +699,7 @@ GetNextCommand(KEYCMD *cmdnum, Char *ch)
|
||||
/* XXX: This needs to be fixed so that we don't just truncate
|
||||
* the character, we unquote it.
|
||||
*/
|
||||
- if (*ch < NT_NUM_KEYS)
|
||||
+ if (*ch > 0 && *ch < NT_NUM_KEYS)
|
||||
cmd = CurrentKeyMap[*ch];
|
||||
else
|
||||
#ifdef WINNT_NATIVE
|
||||
@@ -800,6 +800,10 @@ GetNextChar(Char *cp)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
+ if (cbp == 0 && *cbuf < NT_NUM_KEYS && CurrentKeyMap[(unsigned char)*cbuf] == F_XKEY) {
|
||||
+ *cp = (unsigned char)*cbuf;
|
||||
+ break;
|
||||
+ }
|
||||
cbp++;
|
||||
if (normal_mbtowc(cp, cbuf, cbp) == -1) {
|
||||
reset_mbtowc();
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 28 08:11:47 UTC 2017 - werner@suse.de
|
||||
|
||||
- Add patch tcsh-6.20.00-8bit-cmdkeys.patch
|
||||
Do not convert current used control bytes into wide characters
|
||||
- Extend bindkey.tcsh with 8-bit controls key escape sequences
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 19 12:20:06 UTC 2017 - werner@suse.de
|
||||
|
||||
|
@ -41,6 +41,8 @@ Patch11: tcsh-6.19.00-history-file-locking-order.patch
|
||||
Patch12: tcsh-6.20-rmstar.patch
|
||||
# PATCH-FIX-COMUNITY fix updating pointers to a reallocated buffer of linked list elements
|
||||
Patch13: tcsh-6.20-ptr-update.patch
|
||||
# PATCH-FIX-SUSE Do not convert current used control bytes into wide characters
|
||||
Patch14: tcsh-6.20.00-8bit-cmdkeys.patch
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: ncurses-devel
|
||||
@ -71,6 +73,7 @@ correction, a history mechanism, job control, and a C-like syntax.
|
||||
%patch11 -b .histlckord
|
||||
%patch12 -p1 -b .rmstar
|
||||
%patch13 -p0 -b .ptrbuf
|
||||
%patch14 -p0 -b .8bit
|
||||
%patch0 -b .0
|
||||
|
||||
%build
|
||||
|
Loading…
Reference in New Issue
Block a user