Bug 165923 - there sould be a switch to disable konsole drag and drop feature
Summary: there sould be a switch to disable konsole drag and drop feature
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 2.0
Platform: Fedora RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-07 10:08 UTC by Giacomo Montagner
Modified: 2012-07-06 20:53 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.10


Attachments
Patch to rebuild kdebase using Fedora kdebase-4.0.5 SRPM (403 bytes, patch)
2008-07-08 12:53 UTC, Giacomo Montagner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Giacomo Montagner 2008-07-07 10:11:00 UTC
Version:           2.0 (using KDE 4.0.5)
Installed from:    Fedora RPMs
OS:                Linux

Drag and drop feature in a terminal program can be dangerous.
Let's imagin you're taking some notes about your work, and want to store in a text document the commands you give on the command line along with their output. 
You make the selection on Konsole and then paste on the text editor. 
With KDE 3.5, if you made a selection, clicking on the selection and dragging would start a new selection from where you clicked. Useful if you selected some characters at the beginning or the end of the line more than what you wanted. You move the cursor, click in the right place (even if it's inside the selection you already made) and select again. 

Now, with KDE 4.0/Konsole 2.0, if you click inside the selection and drag, you'll drag the selection. If you the release the mouse button the content of the selection will be pasted on the command line and executed. 

If you want to enjoy the power of drag and drop try this: 
1) log in as root on your machine
2) type this command: 

# echo "I don't want to have this command: 
rm -rf /
run on my system" 

3) type <return> 
Nothing bad happens. 

4) now select only "rm -rf /"
5) click on the selection ant drag it, but not outside the konsole window
6) release your mouse button. 

Can you add a switch in the Konsole settings, to easily turn off drag and drop, so that no selection is dragged but, if user clicks on the selection, another selection is started? 

Thanks.
Comment 1 Giacomo Montagner 2008-07-07 11:01:57 UTC
*** This bug has been confirmed by popular vote. ***
Comment 2 Robert Knight 2008-07-07 17:56:24 UTC
> Can you add a switch in the Konsole settings

I'd prefer a solution which doesn't require more settings for the user to have to tweak.  Reading the bug report it seems that what you are really asking for is the KDE 3.5 behavior back?  

> 5) click on the selection ant drag it, but not outside the konsole window
> 6) release your mouse button. 

You could make the same mistake any number of other ways.  For example, copying a block of commands from a web page or previous command output and then accidentally pasting them in the terminal at the wrong time.    
Comment 3 Robert Knight 2008-07-07 17:56:56 UTC
Unconfirming until I get a clarification of comment #2
Comment 4 Giacomo Montagner 2008-07-08 08:36:50 UTC
I think it's mainly a matter of being used to a certain behaviour rather than another. I'd really like to have the KDE 3.5 no-drag-and-drop behaviour, I asked only for a switch because I thought the feature had been introduced with a reason. For me it's dangerous, I'm too acquainted to what was the previous behaviour, and to paste selections I was only trying to modify already happened too many times. Since I use Konsole at work, on production systems, you may understand I lost some years of life in a few seconds when I realized what was happening :) 

Of course one may paste the wrong selection in a terminal anyway, but:
a) you must be pasting something, using the middle-mouse-button or CTRL-V or anything else. This means you are _aware_ of what you're doing (so should be), and this means you might check the content of the selection before clicking or pressing buttons (Klipper rulez or, better, ruled, since that, too, is no more working in KDE 4.0 - I'm a little bit desperate these days...). I _do_ check, especially when I'm working on a production server... 
b) you might paste the content from a web page, even if the content is made of commands, they rarely work without a little modification. When you drag some commands you just executed before, they work. And sometimes doing the same twice might be no good (imagine an 'rm -rf *' under a /tmp/something being re-done when you are in /etc or similar @_@). 

So, yes: if it is possible to have the no-drag-and-drop back I will be glad. 

Thanks!
Bye. 
Comment 5 Giacomo Montagner 2008-07-08 12:53:36 UTC
Created attachment 25930 [details]
Patch to rebuild kdebase using Fedora kdebase-4.0.5 SRPM
Comment 6 Giacomo Montagner 2008-07-08 12:55:53 UTC
I recompiled kdebase using Fedora 9 SRPM an the patch I posted above. Re-enabling the boolean _ctrlDrag restored the previous behavour, now I'm quite happier :)

Bye!
Comment 7 Stefano Cavallari 2008-07-08 13:04:07 UTC
*** This bug has been confirmed by popular vote. ***
Comment 8 Martin Andersen 2008-09-05 00:31:24 UTC
This goes beyond just accidentally pasting commands into a terminal session. I have on several occasions pasted text into a Pine session which caused it to compose and _send_ an email to a random recipient.

I'm sorry to say, but the current behaviour is just plain silly the way it is implemented. Why should one automatically paste text using only the left mouse button; when the de-facto Unix way of doing things is to employ the middle button?

It doesn't make any sense to me, and it just adds to the numerous quirks which makes KDE 3.5 more usable that KDE4.
(no proxy support, no grouping of icons in the panel, etc.!)
Comment 9 Giacomo Montagner 2008-10-07 10:14:51 UTC
Hi! 
Any news? I got the brand-new kdebase-4.1.1-1.fc9.i386 and the problem popped up again. Since it's really a matter of switching a 0 to a 1 (as I did when recompiled kdebase-4.0.5, re-enabling the use of CTRL for dragging) can't you restore the KDE 3.5 behaviour? 

I'd prefer a flag-switch between the options, anyway. Give the user the power to decide :) 

Bye!
Comment 10 Richard Hartmann 2008-11-10 12:44:48 UTC
Very strong vote from me to get rid of the drag-n-drop alltogether. Personally, I just want Konsole 1.x's behaviour back.

> I'd prefer a solution which doesn't require more settings for the user to have
> to tweak.  Reading the bug report it seems that what you are really asking for
> is the KDE 3.5 behavior back?

Yes.


> You could make the same mistake any number of other ways.  For example, copying
>? a block of commands from a web page or previous command output and then
> accidentally pasting them in the terminal at the wrong time. 

Those involve MMB, shift-insert or edit -> insert, though.


I agree with comment #8, this should simply be removed and reverted to KDE 3 style.
Comment 11 Stefano Cavallari 2008-11-25 18:11:16 UTC
I support the idea to get the old behaviour as in comment #8 
The drag & drop may be useful on a graphical text editor, where 
1) you can always undo your actions
2) you edit documents, not lines. (and terminal text editors can't get the drag & drop right anyway)
On a terminal emulator it's *dangerous* and not useful, as it's very uncommon to paste more than one line. 
I don't see any use case for that. When working in the command line most of the time you just use triple or double click to select the text, then middle click to paste it.
Comment 12 Kurt Hindenburg 2009-03-16 02:24:40 UTC
It likely would be trivial to do this but again it would require another checkbox in the Profile window.  The Advanced tab is already full.

My opinion:
Drag-n-drop from Konsole to another app - OK
Drag-n-drop from another app to Konsole - OK
Drag-n-drop from Konsole to the same Konsole - I don't like this at all
Comment 13 Richard Hartmann 2009-03-16 09:45:20 UTC
As a follow-up to #11: The lack of undo on a shell really is the main issue here. There are way too many actions which you simply can not undo (with reasonable effort).

Again, I think this should simply be removed and reverted to KDE 3 style.
Comment 14 Kurt Hindenburg 2011-01-03 05:27:02 UTC
SVN commit 1211082 by hindenburg:

Revert drag-n-drop to what KDE 3.x used such that CTRL is nowe required.

BUG: 165923


 M  +1 -1      TerminalDisplay.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1211082
Comment 15 Scott Kitterman 2011-09-26 17:18:16 UTC
Sigh.  "Fixing" this is a major usability regression for me.  I've been using the old way for years.  Changing from a mouse only operation to a combined mouse/keyboard operation is a real nuisance.  Please put it back or make it optional.
Comment 16 Jekyll Wu 2011-10-10 21:52:11 UTC
(In reply to comment #15)
> Sigh.  "Fixing" this is a major usability regression for me.  I've been using
> the old way for years.  Changing from a mouse only operation to a combined
> mouse/keyboard operation is a real nuisance.  Please put it back or make it
> optional.

Please take a look at comment #8 and #12.

In the future, if many users complain about this fix and request the KDE3 option , that option may be added, But I doubt it will have corresponding UI in the 'Edit Profile' dialog.  

Personally, I never drag text within konsole or any other emulator.
Comment 17 Scott Kitterman 2011-10-10 22:51:25 UTC
I do it all the time on purpose and I don't think I've ever done it by accident.

This patch is easy enough to revert, so I've locally patched my konsole to work the same way it has for the last three years, but I wish I didn't have to do that.  

I'm not sure what you mean by "request the KDE3 option".  The way it is in 4.7 is the same as KDE3.  I liked the KDE4 way.

I get that not everyone might not like the way it's been the last three years, but I think it's reasonable to make this configurable even if it's not exposed in the UI.  Then at least I wouldn't have to roll my own package.
Comment 18 Giacomo Montagner 2011-10-26 08:16:05 UTC
I'm using konsole Version 2.6.4 from kdebase-4.6.5-2.fc15.x86_64 and drag and drop has been reintroduced. Is it a regression or shall I complain with Fedora package maintainers? 

Thanks.
Comment 19 Jekyll Wu 2011-10-26 08:36:26 UTC
(In reply to comment #18)
> I'm using konsole Version 2.6.4 from kdebase-4.6.5-2.fc15.x86_64 and drag and
> drop has been reintroduced. Is it a regression or shall I complain with Fedora
> package maintainers? 
> 
> Thanks.

No, There is nothing wrong here. The commit message in comment #14 did not mention when it would be available. That commit, AFAIK, is not shipped until KDE-4.7.
Comment 20 Scott Kitterman 2011-10-26 13:11:15 UTC
I'm running 4.7.2, but I don't find the switch this bug asks for?
Comment 21 Jekyll Wu 2011-10-26 13:46:07 UTC
(In reply to comment #20)
> I'm running 4.7.2, but I don't find the switch this bug asks for?

Well, this problem is not solved exactly as requested. 

The KDE3 konsole has a option "require ctrl key for drag and drop", and it is checked by default so the default behavior is ctrl is requried for draging selected text. I think that default behavior is the right choice.

The KDE4 konsole seems to have removed that option in previous versions and ctrl key was not required for draging selected text , which is potentially dangerous. That is why this report is opend. I agree with that opinion, especially comment #12. 

The fix is simply requring ctrl for draging selected text. It does not restore the KDE3 option as requested. I personally think that is OK and enough.

As I mentioned in comment #16, "In the future, if many users complain about this fix and request the KDE3 option, that option may be added". Yes, the latest KDE4 konsole do not have that option and ctrl is ALWAYS required for draging selected text.
Comment 22 Scott Kitterman 2011-10-26 14:08:22 UTC
The problem is that I really liked not having to click control and have never had a problem with it.  I'm currently building my own Konsole to get the previous KDE4 behavior back.  

I don't care which way you default it, but since you've got many years of providing both ways as default, please give users a choice on this, since there is no standard way that everyone is used to.
Comment 23 Scott Kitterman 2012-07-03 03:54:22 UTC
I'd done up a patch to add the selection U/I that works great in my KDE 4.8.4 install.  I've adapted it to KDE master.  It's up on reviewboard.

https://git.reviewboard.kde.org/r/105423/
Comment 24 Kurt Hindenburg 2012-07-06 20:53:19 UTC
Git commit ed31a8b0aa6fcd45177202a60db7167e2498c80f by Kurt Hindenburg.
Committed on 06/07/2012 at 22:37.
Pushed by hindenburg into branch 'master'.

Provde a GUI option to disable requiring CTRL to dnd text

This adds a GUI checkbox per profile to enable/disable requiring the
CTRL key to drag-n-drop text.
The default is to require the CTRL key as before.

Thanks to Scott Kitterman (kde@kitterman.com) for patch.
REVIEW: 105423
FIXED-IN: 4.10

M  +8    -0    src/EditProfileDialog.cpp
M  +1    -0    src/EditProfileDialog.h
M  +10   -0    src/EditProfileDialog.ui
M  +2    -0    src/Profile.cpp
M  +2    -0    src/Profile.h
M  +3    -3    src/TerminalDisplay.cpp
M  +5    -5    src/TerminalDisplay.h
M  +1    -0    src/ViewManager.cpp

http://commits.kde.org/konsole/ed31a8b0aa6fcd45177202a60db7167e2498c80f