Bug 430340

Summary: Entries starting with a space are ignored when moving through the history
Product: [Applications] konsole Reporter: Andrés B.S. <andresbs2000>
Component: historyAssignee: Konsole Developer <konsole-devel>
Status: CLOSED NOT A BUG    
Severity: normal CC: a.samirh78
Priority: NOR    
Version: 20.12.0   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Testing the history with echo "test"

Description Andrés B.S. 2020-12-13 15:39:54 UTC
Created attachment 134053 [details]
Testing the history with echo "test"

As the title says: entries starting with a space are ignored when moving through the history.

i.e.
Try running " env", and press the up arrow
Running "env" does show it in the history.
Taking a look at ~/.bash_history shows the entry is not being stored, so I am not sure if this a bug or a feature.
I attached screenshots that show the history before and after reopneing Konsole. The session at the left picture starts after the clear command in the history at the right picture.
Comment 1 Ahmad Samir 2020-12-13 15:45:44 UTC
Do you have ignorespace enabled for HISTCONTROL:
echo $HISTCONTROL

see https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html#Bash-Variables (or the bash manual page).
Comment 2 Andrés B.S. 2020-12-13 16:00:16 UTC
You are right! I did not know this was thing!
~> echo $HISTCONTROL
ignoreboth

Quote from them (GNU): "A value of ‘ignoreboth’ is shorthand for ‘ignorespace’ and ‘ignoredups’."
Comment 3 Ahmad Samir 2020-12-13 18:40:48 UTC
No problem, bash has many, many options :)