Closed name-snrl closed 5 months ago
BTW, not all OS have /bin/bash
, shouldn't we replace it with #!/usr/bin/env bash
?
p.s. NixOS is one of such non-fhs OS, there is no /bin/bash. although bash bridge works
Any idea why this entire script, line by line, goes into the bash history when I try to complete a command using bash bridge in both nushell and fish?
It is passed in interactive mode to bash. Seems this way it ends up in the history.
export HISTFILE=/dev/null
Turning it off in the script should indeed fix it.
set +o history # temporarily turn off history
#!/usr/bin/env bash?
Can do. I works either way in this case since it is passed directly to the bash command.
Turning it off in the script should indeed fix it.
I think a better solution would be to add +O history
directly to the arguments when calling bash, instead of adding set +o history
to the script, if I understand your suggestion correctly
edit: nvm, there is no history
option in shopt
:(
edit[2]: Yeah, you are right, when set +o history
is the first line of the script, it is not added to history. As for shebang, I don't think it's needed at all if this file is only used in this way.
Any idea why this entire script, line by line, goes into the bash history when I try to complete a command using bash bridge in both
nushell
andfish
?https://github.com/carapace-sh/carapace-bridge/blob/a3a0a4692b57b22a52ee7f3ca0612ef72984f759/pkg/actions/bridge/bash.sh#L1-L25
Every time I try to get a complete for the arguments of
nix-store
, it causes the bash history to be filled with the contents of the script:workaround
carapace version
configuration