In my desktop manager, I have bound fish
to a keyboard shortcut Ctrl + ~. On startup, fish
opens the directory /usr/lib/lightdm/lightdm
. This is quite annoying, because I have no business with lightdm, and I usually work on code in my $HOME
directory.
How can I change the directory that fish starts in? I would like to change the startup directory simply to ~/
If you wish to use fish (or any other shell) as your default shell, you need to enter your new shell's executable /usr/local/bin/fish in two places: add /usr/local/bin/fish to /etc/shells. change your default shell with chsh -s to /usr/local/bin/fish.
The settings that would normally be written to a ~rc file are instead located in the config. fish file at ~/. config/fish . This means the same Bash-style syntax can't be used, so you will have to use the previously written descriptors unique to Fish.
Simply run fish_config to open the web client. From there, you can choose the themes, colors, prompts, inspect the FSH functions and variables, and see the history of commands used. Changes are, in turn, stored in the ~/. config/fish folder and can be accessed and edited there to dodge the optional web configuration.
Just type bash and you'll start the bash shell. type exit to return to fish shell when you're done.
I had found that the config.fish
file that runs at startup had been changing my default working directory.
A misguided attempt at setting my PATH
left a list of directories in my config.fish
, the first of which was /usr/lib/lightdm/lightdm
. Fish automatically assumes directories without a command should be cd
`d into, so my shell was cd
`ing into that directory at startup.
I removed the stray lines and all is well.
To change your fish startup directory:
add cd /path/to/new/startup/directory
to your ~/.config/fish/config.fish
file, or create it if it does not exist.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With