Bug 435957

Summary: Useless "cd <location> items are added to history when switching directories with the Dolphin GUI
Product: [Applications] dolphin Reporter: israel <israeldahl>
Component: panels: terminalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: almazgaliev99, ameyer0, bugseforuns, kfm-devel, nate
Priority: NOR Keywords: usability
Version: 22.04.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description israel 2021-04-20 15:20:46 UTC
SUMMARY
every directory change in the GUI fills the bash history.  Make your program use a different default history, and then only populate the user's bash history (to use in TTY/other terminals) when they input things into the terminal.

STEPS TO REPRODUCE
1. Have the terminal panel present
2. Change directories
3. Change Tabs

OBSERVED RESULT
all my bash history is corrupted with cd /whatever

EXPECTED RESULT
only real user generated commands should be stored this way.  if you need to store the (cd /whatever) do it in some other file.

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.81.0
Qt Version: 5.15.2
Kernel Version: 5.11.14-1-MANJARO
Comment 1 Nate Graham 2021-04-20 19:20:16 UTC
Seems reasonable.
Comment 2 Andrew Meyer 2022-11-04 21:12:39 UTC
A workaround: Some shells have a setting where commands with a leading space don't get added to the history. Dolphin already puts a space before each command it sends to the terminal, i.e. " cd <location>", so enabling this setting in bash should keep the history from getting clogged.

If you use bash, add to .bashrc: HISTCONTROL=ignorespace
If you use zsh, add to .zshrc: setopt HIST_IGNORE_SPACE