开发者

Putty Shift arrows

开发者 https://www.devze.com 2023-03-09 23:10 出处:网络
I want to make Putty recognize shift arrow sequences as i know for example ^[[A means up and ^[[1;2A is shift+up

I want to make Putty recognize shift arrow sequences

as i know for example ^[[A means up and ^[[1;2A is shift+up

I've modified putty source code as following

            if (shift_state == 1)
                if (app_flg)
                    p += sprintf((char *) p, "\x1BO1;2%c", xkey);
                else
                    p += sprintf((char *) p, "\x1B[1;2%c", xkey开发者_运维问答);
            else
                if (app_flg)
                    p += sprintf((char *) p, "\x1BO%c", xkey);
                else
                    p += sprintf((char *) p, "\x1B[%c", xkey);

instead of

                    if (app_flg)
                        p += sprintf((char *) p, "\x1BO%c", xkey);
                    else
                        p += sprintf((char *) p, "\x1B[%c", xkey);

by running cat -vt putty seams to provide correct key code to terminal but in emacs i still can't shift select text (instead it puts text ;2A for up etc.)

running begPutty which already contains this fix (also i don't have source code for it) cat -vt prints the same key codes when using shift arrows and works fine in emacs.

Basically i want to implement begPutty functionality fixes for keycodes but i don't have it's source code


The answer is kitty (KiTTY is a fork from version 0.66 of PuTTY) guys ! My whole life has been a lie : D

http://www.9bis.net/kitty/?page=Download

It has fixed shift+arrow keys bug delivered with putty (also shift+arrow keys was not working in other ssh clients)

After kitty I downloaded sanos editor from here http://www.jbox.dk/sanos/editor.htm

Sanos editor comes like 1 file and is compiled like this:

wget http://www.jbox.dk/downloads/edit.c
gcc -o edit edit.c -Os
./edit edit.c

The only problem with sanos is the buffer is lost once you quit, but you can open many files at once and navigate through the tabs using ctrl+tab also press ctry+y for keymapping help

Putty Shift arrows


I've added emacs as a tag as my opinion is that the problem is in emacs not recognizing your escape sequence and not in your modification of putty.

Could you try with

(define-key input-decode-map "\e[1;2A" [S-up])

in your .emacs, relaunch emacs, press shift up and then CTRL-H L. Emacs should then show you how it interpreted your key press.

0

精彩评论

暂无评论...
验证码 换一张
取 消