You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected this to function like bash history and record comments in the history.
Sometimes I begin writing a complex command and then realize I need more information before I can finish it, so I add a pound at the beginning of the command and press enter so its in my bash history. I collect the needed information, then I Ctrl-R to bring up the commented command and I remove the comment and finish the command.
Contrived example:
$ #for host in prod1e{1,2,3}-nginx-{1,2}; do rsync -avu "$host":/dev/ ...
$ ls /dev
$ forhostin prod1e{1,2,3}-nginx-{1,2};do rsync -avu "$host":/dev/cpuinfo "./$host-cpuinfo";done
What happened?
Commands beginning with # are excluded from the history. However commands with a comment at the end of the line are included which is expected. They don't show up in Ctrl-R search. They do show up in bash's session history (I've disabled the keybinding in atuin, and when I press to navigate history, it's using bash and I see the commented commands).
$ echo comment #comment
comment
$ echo comment follows
comment follows
$ #My little comment
$ echo comment before this
comment before this
$ sqlite3 ~/.local/share/atuin/history.db 'select command from history order by timestamp desc limit 5;'
sqlite3 ~/.local/share/atuin/history.db 'select command from history order by timestamp desc limit 5;'echo comment before this
echo comment follows
echo comment #comment
PS1="\$"
Requested fix
As a non-breaking fix, if there was a log_comments option in the config, then people who desire to have comments in their history would have the option without changing the default behavior for anyone who's come to expect/rely on comments being omitted.
Atuin doctor output
$ atuin doctor
Atuin Doctor
Checking for diagnostics
Please include the output below with any bug reports or issues
What did you expect to happen?
I expected this to function like bash history and record comments in the history.
Sometimes I begin writing a complex command and then realize I need more information before I can finish it, so I add a pound at the beginning of the command and press enter so its in my bash history. I collect the needed information, then I Ctrl-R to bring up the commented command and I remove the comment and finish the command.
Contrived example:
What happened?
Commands beginning with
#
are excluded from the history. However commands with a comment at the end of the line are included which is expected. They don't show up in Ctrl-R search. They do show up in bash's session history (I've disabled the keybinding in atuin, and when I press to navigate history, it's using bash and I see the commented commands).Requested fix
As a non-breaking fix, if there was a
log_comments
option in the config, then people who desire to have comments in their history would have the option without changing the default behavior for anyone who's come to expect/rely on comments being omitted.Atuin doctor output
$ atuin doctor Atuin Doctor Checking for diagnostics Please include the output below with any bug reports or issues
Code of Conduct
The text was updated successfully, but these errors were encountered: