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
Seems reasonable.
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