Questions tagged [fish]
The friendly interactive shell (fish) is a Unix shell that focuses on interactive use, discoverability, and user friendliness.
190
questions
44
votes
6
answers
29k
views
How to remove a path from $PATH variable in fish?
I am using fish as my shell in Debian and recently (after some upgrade) whenever I try to use command completion I have:
set: No such file or directory
set: Could not add component /usr/lib/x86_64-...
2
votes
0
answers
1k
views
My custom fish shell prompt keeps resetting every reboot
I switched to fish shell a month ago and I'm quite pleased with it. But recently, my custom prompt keeps resetting to the default prompt every time I turn on my PC.
When opening the terminal, I'm ...
5
votes
2
answers
6k
views
Change prompt on command line?
My prompt is quite verbose - which is good most of the time - but now I would like to switch it temporarily because I want to make a screen shot of the terminal. For that purpose I would prefer not to ...
0
votes
1
answer
561
views
How to pin information to the top of a terminal window on Mac OSX
I've seen demos where folks have had a Mac OSX terminal where the current time + username + directory are afixed (like 'freeze rows' in excel) to the top of the terminal window (not in the title bar), ...
3
votes
1
answer
17k
views
How can I setup fish shell prompt to be in a different color?
I've seen a screenshot of zsh configured to have prompt with a different color and background, and it looks like a very usable tweak:
2
votes
1
answer
1k
views
writing more complex math input to fish shell
The fish documentation explains that the math command is essentially a thin wrapper to bc. The bc documentation has further info about more complex ops:
If bc is invoked with the -l option, a math ...
18
votes
3
answers
17k
views
How to do command substitution in fish shell?
How would a Bash (or other POSIX shell) command like this have to be expressed in fish?
ls -l $(which vim) # or
ls -l `which vim`
1
vote
1
answer
5k
views
Setting window title with iTerm and Fish
I want to set up a custom profile in iTerm2 that connects directly to a remote machine in tmux, with some custom SSH arguments. I have a fish function that does this, called "ss". When I have this ...
5
votes
2
answers
4k
views
How can I do string manipulation in fish shell
How can I do bash style string manipulations in Fish shell?
Specifically, in bash
read branch < ".git/HEAD"
branch=${branch#ref: refs/heads/}
will put the branch name in $branch variable.
How ...
2
votes
1
answer
284
views
How to sync fish's universal variables across different computers?
If you change some universal variables, how do you sync them across computers? The comments on the fishd.* files make it seem like a bad idea to sync those files. And fishd's man pages don't seem to ...
50
votes
7
answers
20k
views
What is the equivalent of bash's !$ and !! in the fish shell?
I've been using bash for a decade or so and have gotten used to being able to type !$ to repeat the last argument, e.g.:
$ mkdir foo
$ cd !$
cd foo
(That last line is printed by the shell to tell ...
2
votes
2
answers
940
views
Fish shell syntax highlighting looks weird in byobu-screen
When I am in plain fish shell, a command is highlighted like so:
but when I am in byobu-screen and type the same thing, I get:
When I do a fish_config and look at my color palette, nothing is set to ...
2
votes
1
answer
1k
views
How do I run make && make install while in fish shell
I have installed the fish shell, and I'm very happy with it ... but I cannot run the following command:
make && make install
This works nicely in bash... How do I run it in fish shell?
2
votes
1
answer
3k
views
Specifying an alternate shell with rsync
I'm using rsync to sync up files between two computers. On one machine, my default shell is set to fish, which breaks rsync ("protocol version mismatch -- is your shell clean?").
Is there a way to ...
5
votes
2
answers
2k
views
Go-lang go tool works with Bash but not Fish
For those of you who have no idea what Fish is: http://fishshell.com/
Similarly, if you are not familiar with a Go coding environment and still wish to try and figure out this small puzzle, here is ...
15
votes
2
answers
2k
views
Bind shift-tab to complete-backward in fish
I found myself using the auto-complete functionality of the fish-shell, where pressing tab twice or more cycles through the suggestions. But then I accidentaly pressed tab once to many, and I wanted ...
1
vote
0
answers
227
views
Fish - A way to configure it such that it does not scroll through tab completions with tab
If you have a directory structure like the below
./test/locationOne
./test/locationTwo
./test/locationThree
If, with bash, or fish, you type in
cd test/
then hit tab, it will autocomplete until ...
4
votes
1
answer
1k
views
Quote or bracket completion in bash, without pressing TAB
Is there any way to have bash autocomplete matching symbols like '"[{( with their right handed counterparts?
I would like to do this without having to press tab.
For example typing the string echo " ...
65
votes
10
answers
26k
views
Is there a “reverse incremental search” functionality in Fish similar to Bash’s CTRL+R?
I’m really impressed with Fish’s autocomplete functionality. However there is one feature in Bash that I’m unable to find in Fish. When you press Ctrl+R in Bash and begin to type out a term, a search ...
1
vote
2
answers
463
views
Building Fish 2.0 shell under Cygwin
I wanted to have a fish shell under my cygwin instance and I wanted it so bad that I've event tried to build it but with no luck.
I've gone through all the prerequisites like installing autoconf, ...
1
vote
2
answers
1k
views
sshfs or fish:// with root (ssh) login disabled
The server does not allow root login from ssh. I can, however, login as my username and su to root (I know the root pw).
Is there a way to use the fish:// protocol or sshfs or some other way to mount ...
15
votes
3
answers
21k
views
How do I install/make a custom prompt for fish shell?
I'm using fish 2.0 on Linux, but this might be an installation error, since my ~/.config/fish/config.fish is empty.
3
votes
1
answer
1k
views
How to use the $_ positional parameter in the fish shell?
In Bash, the positional parameter $_ holds the last argument in the previous command:
$ /home/joe> some-script foo bar
$ /home/joe> cd $_
$ /home/joe/bar>
The positional parameter $_ does ...
4
votes
1
answer
3k
views
When default shell is not bash-compatible, why do bash scripts not work well?
My default shell is fish, because it's a lot nicer. But often when I run scripts, I get errors that seem to be from the bash script being processed by fish. I think this is because the script writer ...
5
votes
1
answer
3k
views
"set -xe" in fish shell
In bash, invoking set -x at the beginning of a script causes the commands to be printed on stdout while the script is executing. What's the equivalent syntax for the fish shell?
10
votes
3
answers
5k
views
$PATH is driving me nuts
OK, apologies if this is something dumb, but I'm running out of ideas.
Goal: prepend /usr/local/bin to $PATH
Problem: $PATH won't do what I want or expect
How I got here: I want to start learning ...
7
votes
1
answer
6k
views
Right and fast way to test git directory and git branch?
While trying to set up my new fish shell prompt, I ended up testing ways to get the branch name and also testing if I was on a git repository. I have found (1) git rev-parse --abbrev-ref HEAD, (2) git ...
1
vote
1
answer
477
views
fish.config doesn't get loaded on new tab in TotalTerminal on OSX
I want to add Android SDK tools to my $PATH variable. I've entered the following to ~/.config/fish/config.fish:
set -x PATH $PWD/Documents/android-sdk-macosx/tools $PATH
set -x PATH $PWD/Documents/...
101
votes
2
answers
35k
views
chain Fish commands via `&&` or `||`
In Bash/ZSH and other shells, I am used to using && and ||.
Is there any equivalent in Fish?
1
vote
2
answers
1k
views
run any shell script from Fish and import all exported env variables?
Is it possible somehow to import all environment variables which are exported by a subprocess started by Fish?
E.g. from my Fish session, I start bash ~/.profile, which exports some variables and I ...
47
votes
10
answers
41k
views
re-use '~/.profile` for Fish?
(I'm talking about the shell Fish, esp. Fish's Fish.)
For Bash/ZSH, I had ~/.profile with some exports, aliases and other stuff.
I don't want to have a separate config for environment variables for ...
2
votes
1
answer
331
views
How do you install pythonbrew when using the Fish Shell?
I use the Fish shell in Mac OS X and I cannot figure out how to install pythonbrew. Is this possible and if so how? What I think I need to figure out is how to convert the following for my .bashrc to ...
5
votes
1
answer
3k
views
Using MacPorts within FISH shell
I have been playing around with FISH for a few days and I just tried to switch it to my main shell. That worked fine but now none of my software from MacPorts is recognized.
I installed and followed ...
22
votes
3
answers
16k
views
How do I change EDITOR to be Pico in fish shell?
I can’t get Mercurial (hg) to use pico as my EDITOR when I’m using fish shell.
I’ve tried using this and other variations, but nothing seems to help:
set -U EDITOR pico
hg commit will always open ...
5
votes
5
answers
4k
views
fish control-left control-right keybindings
I'm using terminator along with fish and I want to use Alt-Left etc for navigating terminator and Ctrl-Left and Ctrl-right to move the cursor by word. The problem is when I do
bind \cleft backward-...
17
votes
3
answers
12k
views
How to use fish shell in cygwin?
Is it possible to use the fish shell with cygwin? I wasn't able to compile the source in cygwin, and I didn't find any precompiled packages. Is there a good reason for not having fish in cygwin?
67
votes
3
answers
57k
views
Is there any way to get bash to have syntax highlighting like fish?
In the fish shell, the actual command line is syntax highlighted:
Is there any way to get this same behavior in bash?
There is something just like this but for zsh, not bash. Is it possible that ...
19
votes
4
answers
8k
views
sudo keeps asking me for my password in fish shell
sudo in Ubuntu keeps asking me for my password for every command. Previously, I only had to enter the password once, and then it would be remembered for a period of time. This recently changed, ...
17
votes
5
answers
21k
views
How do you "source" a file in fish?
I'd like to use keychain with the fish shell, but I'm not sure how to get fish to load the ~/.keychain/hostname-fish file to set the appropriate environment variables.
In bash, there's the "source" ...
3
votes
3
answers
6k
views
How do I set the title of Terminal.app with the fish shell?
I'm trying the fish shell in Mac OS X, intalled using MacPorts. I'd like to have the title of my Terminal window be my current directory. Currently, the title just says
Terminal - fish - 80x24
...