Search code examples
fish

How to automatically start fish shell in private mode?


Thanks to the developers of Fish for making it possible to launch the shell in private mode :)

However, what am I supposed to add or change in the files fish_prompt.fish and/or config.fish in order to launch fish in private mode automatically when I open a new terminal window?

And if it is possible to launch fish in private mode automatically, is it possible afterwards to launch fish in public mode manually whenever it is necessary?

Thanks for your help!


Solution

  • "Private mode" is a commandline option to fish.

    Instead of launching fish, start fish --private.

    If you want to disable history after you have started fish, set the $fish_history variable to an empty value, i.e. set -g fish_history "". This can also be done in config.fish.