rlivings39 / vscode-fzf-quick-open

vscode extension providing quick file/folder open and searching using fzf
MIT License
77 stars 17 forks source link

Bash history pollution #31

Open janosimas opened 3 years ago

janosimas commented 3 years ago

Currently, every command executed by the extension goes to bash history. If I'm investigation my code, that means a lot of commands.

I suggest that the commands from the extension skip the history. I found two approaches for this: https://stackoverflow.com/a/29188490 https://unix.stackexchange.com/a/10923

The first one looks simpler but it's dependent of the system settings.

rlivings39 commented 3 years ago

I think what could be done here is to leverage the TerminalOptions to allow you to add that environment variable. The proposal would be for the extension to have a setting like "Environment variables" that would be an object specifying env vars and their values. The extension would then pass that along when creating the terminal.

Sound reasonable?

janosimas commented 3 years ago

Feels like an overkill for me, I'll think a little about it. Do you know how gitlens works on that?

rlivings39 commented 3 years ago

Even simpler, what if you leveraged the HISTIGNORE variable in your .bashrc? Setting that for me seems to have done the trick: export HISTIGNORE='*rlivings39.fzf-quick-open*'

I've not seen how gitlens works with that. I'm not in favor of disabling history by default for all users as I find the history integration very helpful. Often I'll switch to the terminal and hit Ctrl+p to do another search, change folder, etc.

janosimas commented 3 years ago

I can use the .bashrc suggestion but I don't think this is a good general solution.

What about a configuration flag?