| Summary: | Clear terminal display when closing and opening it | ||
|---|---|---|---|
| Product: | [Applications] dolphin | Reporter: | Kayra Akman <ckakman> |
| Component: | panels: terminal | Assignee: | Dolphin Bug Assignee <dolphin-bugs-null> |
| Status: | CONFIRMED --- | ||
| Severity: | wishlist | CC: | aasifk106, alexkde, ckakman, nate |
| Priority: | NOR | ||
| Version First Reported In: | 17.12.3 | ||
| Target Milestone: | --- | ||
| Platform: | Kubuntu | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Embedded terminal littered with automatic commands | ||
...It would also destroy the command history. Don't think this makes sense, sorry. (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". 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. 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). 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. 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.
Please submit patches using https://phabricator.kde.org. See https://community.kde.org/Get_Involved/development#Submit_a_patch (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! > (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.
Please comment on patches using Phabricator. This one is https://phabricator.kde.org/D20452 |
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.