mc/lib/tty
Egmont Koblinger 930f683019 Handle newline and tab with shift/ctrl modifiers correctly.
MC already has its own half-ready trick: when pasting with Shift-Insert,
using the X11 extension, the newline ("Enter" as mc calls it) with the
Shift modifier pressed gets converted to a "Return", and in the editor
the Return character inserts a non-indenting newline. This makes pasting
better in terminals not supporting bracketed paste, however, it has some
problems that this commit addresses:

  * Shift+newline gets this special treatment, but Ctrl+newline gets
    dropped. Hence e.g. when pasting in Gnome-terminal with Ctrl+Shift+V
    all the newlines will be missing. This commit adds the same
    non-indenting newline behavior to Ctrl+Newline and Ctrl+Shift+Newline.

  * The code forgets about Tab that also needs special treatment:

    - Most terminals send \e[Z on Shift+Tab, this is not handled by MC
      at all, moreover it causes a hang for about a second. This commit
      teaches this sequence to MC. This is especially useful when no X11
      is available, because there Ctrl+Tab is identical to Tab, so the
      backwards tab feature is not available. With this commit Shift+Tab
      becomes a backwards tab too on all terminals that emit \e[Z.

    - When pasting to the editor, Shift+Tab, Ctrl+Tab and Ctrl+Shift+Tab
      should all insert a tab for the same reason mentioned at the newline.

    - It would look inconsistent in the keymap files to have logical code
      such as "backtab" instead of "shift-tab" and friends, hence get rid
      of KEY_BTAB and use KEY_M_SHIFT | '\t' instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-03 11:41:58 +04:00
..
color-internal.c Ticket 1551: Update GPL version from 2 to 3 2011-10-18 14:08:34 +03:00
color-internal.h Ticket #2169: Add support for 256 colors terminals 2010-12-29 11:58:10 +02:00
color-ncurses.c Ticket 1551: Update GPL version from 2 to 3 2011-10-18 14:08:34 +03:00
color-slang.c Ticket 1551: Update GPL version from 2 to 3 2011-10-18 14:08:34 +03:00
color-slang.h Ticket #2169: Add support for 256 colors terminals 2010-12-29 11:58:10 +02:00
color.c lib/tty/color.c: use unsigned type for conversion between integer and pointer. 2012-12-20 15:18:06 +04:00
color.h Code indentation. 2012-07-17 17:04:05 +04:00
key.c Handle newline and tab with shift/ctrl modifiers correctly. 2013-10-03 11:41:58 +04:00
key.h Ticket #2661: support enable bracketed paste of xterm. 2013-10-03 11:41:58 +04:00
keyxdef.c Ticket 1551: Update GPL version from 2 to 3 2011-10-18 14:08:34 +03:00
Makefile.am Clarify usage of AM_CPPFLAGS. 2012-12-18 16:27:49 +04:00
mouse.c Ticket #3011: mc under x11 problems with mouse or hang due gpm 2013-06-10 20:08:56 +03:00
mouse.h Ticket #3011: mc under x11 problems with mouse or hang due gpm 2013-06-10 20:08:56 +03:00
tty-internal.h (tty_lowlevel_getch): used in lib/tty only. 2011-12-12 12:23:25 +03:00
tty-ncurses.c Ticket #2661: support enable bracketed paste of xterm. 2013-10-03 11:41:58 +04:00
tty-ncurses.h Ticket #3043: broken NCurses detection. 2013-07-23 14:15:24 +04:00
tty-slang.c Ticket #2661: support enable bracketed paste of xterm. 2013-10-03 11:41:58 +04:00
tty-slang.h Code indentation in lib directory 2010-11-24 10:27:20 +03:00
tty.c Ticket #3011: mc under x11 problems with mouse or hang due gpm 2013-06-10 20:08:56 +03:00
tty.h (tty_lowlevel_getch): used in lib/tty only. 2011-12-12 12:23:25 +03:00
win.c Misspellings fixes by https://github.com/vlajos/misspell_fixer 2013-06-15 11:10:41 +04:00
win.h Moved xterm_flag global variable to mc_global.tty.xterm_flag 2011-09-08 14:12:10 +04:00
x11conn.c Tweak sources for --with-x/--without-x option. 2012-11-09 10:05:13 +04:00
x11conn.h Code indentation in lib directory 2010-11-24 10:27:20 +03:00