Bug 375830 - Sending SIGINT to terminal breaks copying file name into a command
Summary: Sending SIGINT to terminal breaks copying file name into a command
Status: RESOLVED FIXED
Alias: None
Product: krusader
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krusader Bugs Distribution List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-01 10:19 UTC by Wladimir Palant
Modified: 2018-05-06 00:16 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Proposed patch (4.85 KB, patch)
2017-02-01 12:50 UTC, Wladimir Palant
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wladimir Palant 2017-02-01 10:19:17 UTC
I am using Krusader compiled from master (revision 5056272) on Ubuntu 16.04 - so the fix for bug 328068 is included. This has a side-effect that copying file name to the embedded terminal is essentially broken:

1. Make sure that embedded terminal enabled but not the command line.
2. Select some file.
3. Switch to the embedded terminal and start typing a command: "ls -l"
4. Now press Ctrl+Enter to copy the file name.

Expected results:

The file name is added to the command and you get something like "ls -l 'foo'"

Actual results:

The command line is cleared by SIGINT and you get only the file name on a new line.
Comment 1 Wladimir Palant 2017-02-01 12:50:51 UTC
Created attachment 103749 [details]
Proposed patch

This leaves clearing current command line as default behavior which is sane. However, this patch adds a parameter clearCommand to the sendInput() method to override this behavior. Inserting the file name and pasting are the scenarios where it is actually undesirable to clear the current command.
Comment 2 Wladimir Palant 2017-02-02 21:13:06 UTC
Now that I figured out how to register for Phabricator I created a proper review: https://phabricator.kde.org/D4419
Comment 3 Alex Bikadorov 2017-02-13 20:42:29 UTC
Git commit 972a8501d8341888aa7b94409c8571bae0c2b59a by Alexander Bikadorov, on behalf of Wladimir Palant.
Committed on 13/02/2017 at 20:38.
Pushed by abikadorov into branch 'master'.

#375830 - Don't send SIGINT to terminal emulator unnecessarily

Summary: This leaves clearing current command line as default behavior which is sane. However, this change adds a parameter `clearCommand` to the `sendInput()` method to override this behavior. Inserting the file name and pasting are the scenarios where it is actually undesirable to clear the current command.

Test Plan: Inserting file name (Ctrl+Enter) shouldn't clear command line, both when the focus is inside the terminal and on the file list. Same should go for pasting text (Ctrl+V inside the terminal). The automatic `cd` command sent when current directory changes in the list should still clear command line (bug 328068 should not regress).

Reviewers: #krusader, abika, martinkostolny, asensi

Reviewed By: #krusader, abika, martinkostolny, asensi

Subscribers: asensi, martinkostolny, abika, #krusader

Tags: #krusader

Differential Revision: https://phabricator.kde.org/D4419

M  +11   -9    krusader/GUI/terminaldock.cpp
M  +1    -1    krusader/GUI/terminaldock.h
M  +1    -1    krusader/krslots.cpp

https://commits.kde.org/krusader/972a8501d8341888aa7b94409c8571bae0c2b59a