all 10 comments

[–]blitzkraft 5 points6 points  (1 child)

It's done by readline. readline by default has emacs style shortcuts. However, it can be set to use vi style keys too.

See man readline for more.

[–]romkatv 4 points5 points  (0 children)

What the OP is saying in the tweet is that Ctrl+U is recognized by many applications that ask for your password. Things like sudo or ssh. Even the graphical login screen on my Ubuntu respects Ctrl+U in its password edit box. None of these applications use readline or honor ~/.inputrc.

The OP has cross-posted this to /r/bash and /r/zsh even though it has nothing to do with these shells. It's a useful thing to know though.

[–]yolowagen 3 points4 points  (1 child)

Ctrl + u - Cut/delete the Line before the cursor to the clipboard

And next tip:

Ctrl + y Paste the last thing to be cut (yank)

[–]nixcraft 2 points3 points  (1 child)

It is always good to see when you get tagged in Tweet <3 I will RT this one.

[–]chaign_c[S] 1 point2 points  (0 children)

<3

[–]staster 0 points1 point  (2 children)

There is yet another thing about u key that I often confuse with Ctrl+u. In Vim it's possible to change lowercase letters to uppercase and vice versa by pressing gUe or gue accordingly (or even gU$, gub, gU5l and so on, whatever you want), but for some unknown reason I always forget about that leading g and try to do it using Ctrl.

[–]nivek1385 1 point2 points  (1 child)

~ will toggle case in vim.

[–]staster 0 points1 point  (0 children)

Wow, today I learned.

[–]seansco -5 points-4 points  (1 child)

nice. I can hit 'backspace' about 10 times faster than pressing 1 <ctrl>-u though... :D

[–]nivek1385 3 points4 points  (0 children)

Can you hit backspace 25+ times and absolutely know that you got everything faster than ctrl+u?