After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777405 - Shortcut key for selecting/highlighting the current line
Shortcut key for selecting/highlighting the current line
Status: RESOLVED DUPLICATE of bug 78291
Product: gnome-terminal
Classification: Core
Component: Keybindings
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Reported: 2017-01-17 20:29 UTC by Hobson Lane
Modified: 2017-04-30 20:25 UTC
See Also:
GNOME target: ---
GNOME version: ---

Description Hobson Lane 2017-01-17 20:29:33 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: ?
Comment 1 Egmont Koblinger 2017-01-17 22:02:40 UTC

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.
Comment 2 Christian Persch 2017-01-18 21:29:06 UTC
Dup of bug 78291 (keyboard selection), I think.
Comment 3 Christian Persch 2017-04-30 20:25:20 UTC

*** This bug has been marked as a duplicate of bug 78291 ***