Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to include commands that start with # in history #467

Closed
norpol opened this issue Jun 29, 2022 · 7 comments · May be fixed by #1319
Closed

Add option to include commands that start with # in history #467

norpol opened this issue Jun 29, 2022 · 7 comments · May be fixed by #1319

Comments

@norpol
Copy link

norpol commented Jun 29, 2022

A common use-case for me is to

  • write a command
  • go to the beginning of the line
  • add a #
  • then doing some other command first to retrieve some data
  • go into the shell history, select the commented out command, paste the extracted data, remove the #

Very basic example to illustrated what I'm doing also recorded on asciinema

This appears not to be compatible with atuin right now, as adding a # is the equivalent of adding a at the beginning of the line.

@conradludgate
Copy link
Collaborator

# prefix seems to work for me 🤔.

Screenshot 2022-06-29 at 14 02 49

@norpol
Copy link
Author

norpol commented Jun 29, 2022

Really weird, if I'm just using the standard zsh history search it shows up but not in atuin search -i

image
image

@conradludgate
Copy link
Collaborator

This might just be a quirk of the import script. Can you try it in a fresh terminal session to see if it shows up there?

@norpol
Copy link
Author

norpol commented Jun 29, 2022

No it still doesn't show up
image
image

@millette
Copy link
Contributor

millette commented Oct 13, 2022

Using bash and #ed commands aren't showing up for me either. I use them for temporary commands I'll be rewriting.

EDIT: Hmm, seems to be working now, not sure what happened earlier when I tried.

In bash (I don't know about other shells), we can skip history by preceding a command with a space (if it contains a password for example).

Sort of related: #70 and #350.

@ellie
Copy link
Member

ellie commented Oct 18, 2023

I can't replicate this, no matter what I try. It seems like other people can't replicate it either. We also don't have anything specific that would ignore a # prefix.

I'm going to close this for now, but happy to reopen should it occur + have a replication case we can work with!

@ellie ellie closed this as not planned Won't fix, can't repro, duplicate, stale Oct 18, 2023
@norpol
Copy link
Author

norpol commented Oct 21, 2023

@ellie Do you have setopt interactivecomments activated? Otherwise # is not detect as a comment by zsh. I just started with an empty .zshrc entered setopt interactivecomments and the issue is still there. Previous zsh-histdb would still store this in the history, same as zsh's built in history.

The issue is that atuin is using add-zsh-hook preexec _atuin_preexec to collect the history, I suppose zsh-histdb is using another way to hook into the history, since a command with # is never going to make it into preexec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants