GNOME Bugzilla – Bug 777405
Shortcut key for selecting/highlighting the current line
Last modified: 2017-04-30 20:25:20 UTC
Shift-ctrl-c is great for grabbing text from the terminal, but I wish I could highlight the current line with the keyboard as well. It's the "missing link" for my workflow. Some ideas for hotkeys:
* [shift]-[ctrl]-[a] to cause cursor to move to the beginning of line "dragging" highlighting along the way
* [ctrl]-[a] in series to select ever more text:
- once to grab current line
- twice to grab current line including prompt
- thrice to grab "page"
- fource to grab entire session
* gedit style: [shift]-[arrow-key] to move cursor as normal, but drag highlighting along the way
* vim style (seems awkward): ? [shift]-[ctrl]-[h] and [i] to move cursor left/right while highlighting
* emacs style: ?
* nano style: ?
Sure it would be great for some users to select text without using the mouse. It's not possible at the moment (except for using X Window's mouse emulation with keyboard, or similar tricks). I'm not aware of any plans to address this any time soon, it's definitely not on my radar.
I do have several problems with your proposal, though.
> It's the "missing link" for my workflow.
If something like this is implemented, we should not address _your_ needs in particular, but provide a generic solution for everyone to select text using the keyboard between any two points.
> cause cursor to move
If we're talking about the same thing here, namely the rectangle (by default) cursor that shows where you'll be typing, then no hotkey should ever move it unbeknownst to the app (well, the "reset and clear" menu entry breaks it, causing quite a confusion for many users), it's the app running inside that should have full control of it. So we need the concept of a different kind of cursor, solely for marking the beginning and end of selection. Oh, and they should both be able to differ from the actual cursor.
> [ctrl]-[a] in series
Ctrl+letter are important for the apps running inside the terminal emulator; the terminal should not handle them specially. Some hotkeys, e.g. Ctrl+Shift+F for finding text bring in a special context, namely a popup window, which is obvious to the user that it's a different context. Others, e.g. Ctrl+Shift+C for copying text executes immediately and don't have a context switch. Currently the terminal emulator doesn't have such a mode as your Ctrl+Shift+A selection suggests. It should be somehow clearly communicated to the user that the emulator has switched to a different mode, how to use and how to leave that mode. Or if it's not a special mode then Ctrl+A needs to send Ctrl+A to the app running inside, so you're practically limited to Ctrl+Shift+letter for all the actions (incl. moving the boundaries of the selection, etc.) we'd need to support.
> - once to grab current line [excluding the prompt, as I take it from the next entry]
The terminal emulator has absolutely no idea where the prompt is. In fact, it has no idea whatsoever what a prompt is.
> - fource to grab entire session
This is available currently as Edit -> Select All, you can assign a hotkey.
>* gedit style [etc...]
gnome-terminal is a GUI app trying to follow GNOME UI/UX guidelines as much as it makes sense. It is not a terminal app like bash which offers both vim and emacs style editing modes, let alone 5(!!!) different ways as you suggest. If ever implemented, probably all the configuration you'll have will be the hotkey that enters selection mode.
Dup of bug 78291 (keyboard selection), I think.
*** This bug has been marked as a duplicate of bug 78291 ***