When changing folders in dolphin new(cd) entries are added to history making it difficult to fine commands. How do i prevent Dolphin from make these?
What is a “new(cd)” entry, where it is located? If you mean Back and Forward buttons (click and hold), it is normal to record each directory in history. If you mean Dolphin terminal (up/down keys) then it is also normal to record each command.
Dolphin adds a space character in front of cd commands which usually should make your shell not write them to history. If that does not work you will need to configure your shell accordingly, for example for bash it would mean setting the HISTCONTROL environment variable to either ignorespace or ignoreboth
I mean navigating folders in Dolphin. Opening a folder, or going up/back
Just to clarify to .bashrc I should add
HISTCONTROL=ignorespace
export HISTCONTROL
Yes, but you can skip the export. Just adding HISTCONTROL=ignorespace anywhere to .bashrc should do the trick.
By the way, for zsh the same can be achieved by adding setopt HIST_IGNORE_SPACE to .zshrc
So I think there’s some confusion here - are you talking about the mirrored commands in the embedded terminal (I generated these entries by clicking to navigate, and commands appear in the terminal mirroring the terminal activity).
This looks different in mine because I use icd instead of normal cd but I’m sure it’s the same deal.
However, the HISTORY isn’t really polluted as long as you set ignore duplicates.
A great deal also depends on what shell you use… but the thing to remember is the EMBEDDED terminal is a mirror for the GUI - so it really should behave like that.
Now having a thousand cd commands doesn’t make it remotely difficult to find commands.
Here you can see that I have a massive history, and typing ‘cd’ into a fuzzy search brings up a massive list of ridiculously pointless history.
You must learn to search and narrow it down - it’s more important to store the history than it is to keep it only limited to useful content - we keep it lean by ignoring some stuff, and you can exclude a command by typing a space before it.
The beauty here is that you can type to narrow down any command you typed, as long as you have the fuzziest memory - fuzzy finding and searching history is an amazing tool.
So, learn about fzf, learn about zoxide, and maybe consider sharing and discussing your shell configuration file with a view to improve it and make it better.
The more information you can give, the more that people can actively participate and actually help.
I didn’t use zsh much for a while, but I do have this section which helps with history:
export HISTFILE="$HOME/.zsh_history"
export SAVEHIST=$(( 50 * 1000 ))
export HISTSIZE=$(( 12 * SAVEHIST / 10 ))
export ZSH_COMPDUMP="$HOME/.cache/zcompdump"
HIST_STAMPS="yyyy-mm-dd HH:MM:SS"
Also options:
export HISTFILE="$HOME/.zsh_history"
export SAVEHIST=$(( 50 * 1000 ))
export HISTSIZE=$(( 12 * SAVEHIST / 10 ))
export ZSH_COMPDUMP="$HOME/.cache/zcompdump"
HIST_STAMPS="yyyy-mm-dd HH:MM:SS"
setopt appendhistory # Append rather than overwrite history
setopt inc_append_history # Save commands immediately
setopt extendedhistory # Save timestamp and duration
setopt histignorealldups # Remove older duplicate commands
setopt histignorespace # Ignore commands starting with space
setopt HIST_FIND_NO_DUPS # Don't show duplicates in history search
setopt share_history # Add this line with your other setopt lines
Here’s my Ctrl_R search in ZSH:
I prefer fish these days ![]()



