Bug 430340 - Entries starting with a space are ignored when moving through the history
Summary: Entries starting with a space are ignored when moving through the history
Status: CLOSED NOT A BUG
Alias: None
Product: konsole
Classification: Applications
Component: history (show other bugs)
Version: 20.12.0
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-13 15:39 UTC by Andrés B.S.
Modified: 2020-12-13 18:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Testing the history with echo "test" (32.06 KB, image/png)
2020-12-13 15:39 UTC, Andrés B.S.
Details

Note You need to log in before you can comment on or make changes to this bug.
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 :)