Bug 327395 - Select the current line using the keyboard
Summary: Select the current line using the keyboard
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: copy-paste (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-10 09:39 UTC by Christian Couder
Modified: 2014-02-17 14:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.13


Attachments
first patch to fix it (developed on master) (2.21 KB, patch)
2013-11-10 09:44 UTC, Christian Couder
Details
second patch to fix it (developed on master) (2.35 KB, patch)
2013-11-10 09:45 UTC, Christian Couder
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Couder 2013-11-10 09:39:10 UTC
There is a "Select All" menu item to select all the lines, but most of the time I want to select just the current line, not everything, and then copy it into another application (usually a text editor).

I know that I can triple click using the mouse to select any line, but I don't like to use the mouse.

So I would very much like it, if it was possible to select the current line using a shortcut.

I have written some patches to do it and I will attach them to this bug or send it to the mailing list when I will be subscribed (currently I am waiting for oderator approval).


Reproducible: Always
Comment 1 Christian Couder 2013-11-10 09:44:24 UTC
Created attachment 83464 [details]
first patch to fix it (developed on master)
Comment 2 Christian Couder 2013-11-10 09:45:19 UTC
Created attachment 83465 [details]
second patch to fix it (developed on master)
Comment 3 Kurt Hindenburg 2013-11-10 13:22:59 UTC
Thanks - your sub is approved - typically we prefer if patches go to reviewboard.kde.org - use the group konsole
Comment 4 Christian Couder 2013-11-16 09:29:31 UTC
What are the next steps? Are you going to integrate the patches or do you want me to do something?
Thanks.
Comment 5 Kurt Hindenburg 2013-11-16 15:11:55 UTC
It is fine - I'll take care of it
Comment 6 Kurt Hindenburg 2013-11-16 15:46:32 UTC
I'm curious what you're doing to want this.  It appears to me that the  current line is always the prompt line (in a shell).  Any apps that are on the 2nd screen like vi/etc won't work.
Comment 7 Christian Couder 2013-11-16 20:34:28 UTC
For example when I write shell scripts, or when I write some documentation about doing some things using the command line, I often try commands on the command line and then I copy paste them in an editor.

And by the way my prefered editor is emacs, so I am not very much interested in vi or other command line applications. But I can have a look to make it work when using vi or other terminal based applications.
Comment 8 Christian Couder 2013-11-16 20:44:05 UTC
And it looks like the Select All command doesn't work in vi either.
Comment 9 Christian Couder 2014-02-11 06:24:26 UTC
Are there any plans to merge the patches I sent?
Thanks!
Comment 10 Kurt Hindenburg 2014-02-12 14:53:15 UTC
I'll look at this again - thanks
Comment 11 Kurt Hindenburg 2014-02-12 17:12:43 UTC
Git commit c5beb590325c02ccb770189b6219503525b818e8 by Kurt Hindenburg.
Committed on 12/02/2014 at 17:08.
Pushed by hindenburg into branch 'master'.

Split mouseTripleClickEvent method into selectLine()

Use a helper method selectLine() which is most of the
mouseTripleClickEvent().  Also, in preparation for upcoming patch to
allow selectLine per shortcut.

M  +6    -1    src/TerminalDisplay.cpp
M  +1    -0    src/TerminalDisplay.h

http://commits.kde.org/konsole/c5beb590325c02ccb770189b6219503525b818e8
Comment 12 Kurt Hindenburg 2014-02-12 17:29:43 UTC
Git commit ce554872049cc07728bd25912109d9c54f25ee30 by Kurt Hindenburg.
Committed on 12/02/2014 at 17:24.
Pushed by hindenburg into branch 'master'.

Add parameter to selectLine for selecting entire line

This will allow selectLine() to be called outside of using the Enum::
SelectWholeLine and SelectForwardsFromCursor.  If more Enums are added
this code will need adjusted.

M  +5    -4    src/TerminalDisplay.cpp
M  +1    -1    src/TerminalDisplay.h

http://commits.kde.org/konsole/ce554872049cc07728bd25912109d9c54f25ee30
Comment 13 Kurt Hindenburg 2014-02-12 19:28:36 UTC
Git commit 7cf548bea8a7c3c5da4a0dd00c3a7e677f0481c8 by Kurt Hindenburg.
Committed on 12/02/2014 at 19:22.
Pushed by hindenburg into branch 'master'.

All 'select line' for use with shortcut

Select entire line from a shortcut.

Patch by Christian Couder chriscool@tuxfamily.org
FIXED-IN: 2.13

M  +9    -0    src/SessionController.cpp
M  +1    -0    src/SessionController.h
M  +7    -0    src/TerminalDisplay.cpp
M  +3    -0    src/TerminalDisplay.h

http://commits.kde.org/konsole/7cf548bea8a7c3c5da4a0dd00c3a7e677f0481c8
Comment 14 Kurt Hindenburg 2014-02-17 14:29:55 UTC
Git commit 931cf74e6303b25604e932d228376c4c115157f8 by Kurt Hindenburg.
Committed on 12/02/2014 at 17:08.
Pushed by hindenburg into branch 'frameworks'.

Split mouseTripleClickEvent method into selectLine()

Use a helper method selectLine() which is most of the
mouseTripleClickEvent().  Also, in preparation for upcoming patch to
allow selectLine per shortcut.
(cherry picked from commit c5beb590325c02ccb770189b6219503525b818e8)

M  +6    -1    src/TerminalDisplay.cpp
M  +1    -0    src/TerminalDisplay.h

http://commits.kde.org/konsole/931cf74e6303b25604e932d228376c4c115157f8
Comment 15 Kurt Hindenburg 2014-02-17 14:29:57 UTC
Git commit 801d4d4b8c7ea6bd1b71c7544002adb6582e9b9c by Kurt Hindenburg.
Committed on 12/02/2014 at 17:24.
Pushed by hindenburg into branch 'frameworks'.

Add parameter to selectLine for selecting entire line

This will allow selectLine() to be called outside of using the Enum::
SelectWholeLine and SelectForwardsFromCursor.  If more Enums are added
this code will need adjusted.
(cherry picked from commit ce554872049cc07728bd25912109d9c54f25ee30)

M  +5    -4    src/TerminalDisplay.cpp
M  +1    -1    src/TerminalDisplay.h

http://commits.kde.org/konsole/801d4d4b8c7ea6bd1b71c7544002adb6582e9b9c
Comment 16 Kurt Hindenburg 2014-02-17 14:29:58 UTC
Git commit 0f84f38c0aa3c7bc9929fedf8b5aedcc937995dc by Kurt Hindenburg.
Committed on 12/02/2014 at 19:22.
Pushed by hindenburg into branch 'frameworks'.

All 'select line' for use with shortcut

Select entire line from a shortcut.

Patch by Christian Couder chriscool@tuxfamily.org
FIXED-IN: 2.13
(cherry picked from commit 7cf548bea8a7c3c5da4a0dd00c3a7e677f0481c8)

M  +9    -0    src/SessionController.cpp
M  +1    -0    src/SessionController.h
M  +7    -0    src/TerminalDisplay.cpp
M  +3    -0    src/TerminalDisplay.h

http://commits.kde.org/konsole/0f84f38c0aa3c7bc9929fedf8b5aedcc937995dc