Bug 393737 - Clear terminal display when closing and opening it
Summary: Clear terminal display when closing and opening it
Status: CONFIRMED
Alias: None
Product: dolphin
Classification: Applications
Component: panels: terminal (other bugs)
Version First Reported In: 17.12.3
Platform: Kubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-01 17:26 UTC by Kayra Akman
Modified: 2019-04-11 21:38 UTC (History)
4 users (show)

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


Attachments
Embedded terminal littered with automatic commands (82.17 KB, image/png)
2018-05-01 17:26 UTC, Kayra Akman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kayra Akman 2018-05-01 17:26:57 UTC
Created attachment 112350 [details]
Embedded terminal littered with automatic commands

If embedded terminal is visible in Dolphin, navigating to other folders with mouse makes ^C and cd /... commands automatically executed in the embedded terminal. These commands are also run when embedded terminal is disabled and enabled with F4 without changing the current directory.

Executing clear upon folder change would keep the embedded terminal clean.
Comment 1 Nate Graham 2018-05-01 19:06:35 UTC
...It would also destroy the command history. Don't think this makes sense, sorry.
Comment 2 Kayra Akman 2018-05-01 19:16:05 UTC
(In reply to Nate Graham from comment #1)
> ...It would also destroy the command history. Don't think this makes sense,
> sorry.

clear command doesn't delete the command history. I didn't understand what you meant by "destroying".
Comment 3 Nate Graham 2018-05-01 19:18:57 UTC
Ah, you were literally referring to the `clear` command. You're right, but it does make it harder to see the history since more scrolling would be required. Maybe.
Comment 4 Kayra Akman 2018-05-01 19:24:35 UTC
At least executing 'clear' when embedded terminal is opened with F4 is a good compromise.

Dolphin already automatically executes 'clear' after cd'ing to home folder when a new Dolphin window is opened with embedded terminal enabled. This would be also meaningful when embedded terminal is opened with F4 (or via menu entry).
Comment 5 Christoph Feck 2018-05-01 20:05:02 UTC
The terminal is not only for input, it is also an output window. And I don't want my terminal to clear its output just because I click on a folder.
Comment 6 Aasif Khan 2019-04-10 20:10:14 UTC
diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp
index 8dedd0be1..4e3ccc5cd 100644
--- a/src/panels/terminal/terminalpanel.cpp
+++ b/src/panels/terminal/terminalpanel.cpp
@@ -223,6 +223,7 @@ void TerminalPanel::sendCdToTerminal(const QString& dir, HistoryPolicy addToHist
 #endif
 
     m_terminal->sendInput(" cd " + KShell::quoteArg(dir) + '\n');
+    m_terminal->sendInput("clear\n");
 
     // We want to ignore the currentDirectoryChanged(QString) signal, which we will receive after
     // the directory change, because this directory change is not caused by a "cd" command that the
(In reply to Kayra Akman from comment #0)
> Created attachment 112350 [details]
> Embedded terminal littered with automatic commands
> 
> If embedded terminal is visible in Dolphin, navigating to other folders with
> mouse makes ^C and cd /... commands automatically executed in the embedded
> terminal. These commands are also run when embedded terminal is disabled and
> enabled with F4 without changing the current directory.
> 
> Executing clear upon folder change would keep the embedded terminal clean.

(In reply to Kayra Akman from comment #0)
> Created attachment 112350 [details]
> Embedded terminal littered with automatic commands
> 
> If embedded terminal is visible in Dolphin, navigating to other folders with
> mouse makes ^C and cd /... commands automatically executed in the embedded
> terminal. These commands are also run when embedded terminal is disabled and
> enabled with F4 without changing the current directory.
> 
> Executing clear upon folder change would keep the embedded terminal clean.
Comment 7 Nate Graham 2019-04-10 20:15:39 UTC
Please submit patches using https://phabricator.kde.org. See https://community.kde.org/Get_Involved/development#Submit_a_patch
Comment 8 Aasif Khan 2019-04-10 20:48:55 UTC
(In reply to Nate Graham from comment #7)
> Please submit patches using https://phabricator.kde.org. See
> https://community.kde.org/Get_Involved/development#Submit_a_patch

Submitted the patch!
Comment 9 alexkde 2019-04-11 21:22:29 UTC
> (In reply to Nate Graham from comment #7)
>> Please submit patches using https://phabricator.kde.org. See
>> https://community.kde.org/Get_Involved/development#Submit_a_patch

Actually this looks rather like a bad workaround to me than a real bug fix. :-/
I'd prefer to find the root cause of "\C" and "cd <path>" whenever the terminal is hidden and reopened again by hitting F4.
Comment 10 Nate Graham 2019-04-11 21:38:49 UTC
Please comment on patches using Phabricator. This one is https://phabricator.kde.org/D20452