Bug 328068 - Automatic sending chdir to embedded terminal may lead to tragic consequences if some command is already typed.
Summary: Automatic sending chdir to embedded terminal may lead to tragic consequences ...
Status: RESOLVED FIXED
Alias: None
Product: krusader
Classification: Applications
Component: general (other bugs)
Version First Reported In: 2.4.0-beta3 "Single Step"
Platform: unspecified All
: NOR normal
Target Milestone: ---
Assignee: Krusader Bugs Distribution List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-25 16:21 UTC by Dmitry Alexandrov
Modified: 2018-05-06 00:16 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Alexandrov 2013-11-25 16:21:59 UTC
On chage working directory in panel Krusader sends cd to terminal emulator regardless of whether command line empty or not. So if you will leave there some unfinished command, ‘cd '/path/to/dir/'’ will be blindly appended to it and result will be executed.

Reproducible: Always

Steps to Reproduce:
1. Make sure that ‘Terminal Emulator sends Chdir on panel change’ option is enabled.
2. Open embedded terminal emulator.
3. Type ‘rm -rf ’.
4. Switch to panel, press ~ (shortcut for open home dir).
5. $ rm -rf cd '/home/username/' have been executed.
Actual Results:  
Oops!

Expected Results:  
At least Krusader should send ^U before sending cd '...' to terminal.
Comment 1 Alex Bikadorov 2017-01-27 18:51:19 UTC
Git commit 2aaba3ea1881e30b65b4dce8a758da1a72c011f9 by Alexander Bikadorov.
Committed on 27/01/2017 at 18:48.
Pushed by abikadorov into branch 'master'.

FIXED: [ 328068 ] Send SIGINT before own input command to embedded terminal

To avoid unwanted behaviour by line concatenation.

M  +11   -2    krusader/GUI/terminaldock.cpp

https://commits.kde.org/krusader/2aaba3ea1881e30b65b4dce8a758da1a72c011f9
Comment 2 Alex Bikadorov 2017-01-27 18:52:43 UTC
"^C" (SIGINT) is send before command (not only chdir but also user action commands).
Comment 3 Wladimir Palant 2017-02-01 10:19:56 UTC
I filed bug 375830 on a regression that this caused.