Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 481754 - app-shells/bash-4.2_p45 - binding kill-whole-line to ^U fails
Summary: app-shells/bash-4.2_p45 - binding kill-whole-line to ^U fails
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-20 13:56 UTC by Johnny Wezel
Modified: 2013-08-27 05:27 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge-info,5.01 KB, text/plain)
2013-08-20 13:56 UTC, Johnny Wezel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johnny Wezel 2013-08-20 13:56:12 UTC
Created attachment 356490 [details]
emerge --info

I cannot bind kill-whole-line to ^U. See what happens:

j@starfish ~ $ bind -p | grep kill
"\C-x\C-?": backward-kill-line
"\e\C-h": backward-kill-word
"\e\C-?": backward-kill-word
# copy-region-as-kill (not bound)
"\C-k": kill-line
# kill-region (not bound)
# kill-whole-line (not bound)
"\ed": kill-word
# shell-backward-kill-word (not bound)
# shell-kill-word (not bound)
j@starfish ~ $ bind '"\C-u": kill-whole-line'
j@starfish ~ $ asdlkj asd # whole line should be killed^C
j@starfish ~ $ bind -p | grep kill
"\C-x\C-?": backward-kill-line
"\e\C-h": backward-kill-word
"\e\C-?": backward-kill-word
# copy-region-as-kill (not bound)
"\C-k": kill-line
# kill-region (not bound)
# kill-whole-line (not bound)
"\ed": kill-word
# shell-backward-kill-word (not bound)
# shell-kill-word (not bound)
j@starfish ~ $ bind '"\M-u": kill-whole-line'
j@starfish ~ $ bind -p | grep -- -u
"\e~": complete-username
"\C-x~": possible-username-completions
"\C-x\C-u": undo
"\C-u": unix-line-discard
j@starfish ~ $ bind '"\C-]": kill-whole-line'
j@starfish ~ $ <====================== Whole line killed with ^]. OK
j@starfish ~ $ bind -r '"C-u"' <===== Removing ^U binding
j@starfish ~ $ bind -p | grep C-u
"\C-x\C-u": undo
"\C-u": unix-line-discard <===== ^U binding still here

Conclusion:
-----------

- Unbinding does not work
- Binding a key that already exists cannot be reassigned
Comment 1 SpanKY gentoo-dev 2013-08-27 05:27:09 UTC
i'm almost certain this is due to your tty settings and not bash/readline

$ man stty
       kill CHAR
              CHAR will erase the current line

$ stty -a | grep -o 'kill[^;]*'
kill = ^U

so you first need to change your tty settings with `stty`, and then use bash's `bind` to set it to something else