5 ms·
True, but c-k also works and so does, c-a, so with c-a, c-k you can get the same effect with not too much more effort.
by Exuma 6y ago
True, but c-k also works and so does, c-a, so with c-a, c-k you can get the same effect with not too much more effort.
- Hackbraten 6y agoNot really because unlike c-u, the c-a c-k combo deletes the whole line, while I actually wanted to delete only the rest of the line. My workaround is ⇧⌘→ followed by Backspace but that always feels a little awkward to me.
- Exuma 6y agoYou might be confusing c-u with c-k? c-u deletes the entire line regardless of where the cursor is (in terminal). outside of terminal, c-a goes to beginning of line, and c-k deletes from the current cursor to the end of the line. Perhaps you should try c-k instead of ⇧⌘→.
- Hackbraten 6y agoYou’re right, I confused it but my point still stands. What I really meant to say: Not really because unlike c-u, the c-a c-k combo deletes the whole line, while I actually wanted to delete only the part of the line up to the cursor. My workaround is ⇧⌘← followed by Backspace but that always feels a little awkward to me.
- Exuma 6y agoAhhh yes, in that case I don't think there's a readline hotkey for that. However what I do is just command+backspace (no shift)
- Hackbraten 6y agoTIL!
- dnhz 6y agoNo. C-u deletes between the beginning of the line and where the cursor is. In iterm at least.
- Exuma 6y agoI tested in both iTerm and Terminal and c-u for me deletes the entire line regardless of cursor... hmm
- dnhz 6y agoI can confirm that C-u has the behavior I described for me. Running Mojave. It's very useful at times in terminal as a sort of "reflected" C-k shortcut. The way it behaves for me matches the description here: https://man7.org/linux/man-pages/man3/readline.3.html https://man7.org/linux/man-pages/man3/readline.3.html