Fish is a unix shell with a clean design and a limited but powerful feature set.

learn more… | top users | synonyms

24
votes
8answers
2k views

Dealing with file names with special first characters (ex. ♫)

I have recently come across a file whose name begins with the character '♫'. I wanted to copy this file, feed it into ffmpeg, and reference it in various other ways in the terminal. I usually ...
1
vote
1answer
50 views

Can I use modulecmd with fish shell?

At work we use the Environment Modules package (and hence modulecmd) extensively. man module includes the sentence “The sh, csh, tcsh, bash, ksh, and zsh shells are supported by modulecmd.” This is ...
1
vote
2answers
49 views

Bash to Fish Conversion: Display custom message when CD'ing into a specific directory

Basically, I'd like to create a file .cd-reminder with an announcement/message inside a specific directory. It will be displayed every time someone 'cd' into that specific directory. There is a shell ...
4
votes
1answer
48 views

sudo and fish: no credential caching

I use fish as my standard shell. And I use sudo sometimes. But I'm having problems with credential caching. On an Ubuntu system, this works: niklas@Niklas-Mobil~> sudo true [sudo] password for ...
1
vote
2answers
48 views

Start several fish shells in different directories?

In order to be able to launch my work environment with a single command, I want to start several urxvt windows running fish shell in different folders. However, I found no obvious way of having fish ...
2
votes
2answers
49 views

how to set and use multiple parameters in single environmental variable in fish shell

I want to use following in fish shell: $ export arm='ARCH=arm CROSS_COMPILE=arm-eabi-' $ make $arm This works fine in bash/zsh but not on fish shell. But if I execute the following in fish shell: ...
2
votes
1answer
234 views

Queue a task in a running shell

I often start a long running command that is bound to either CPU, Disk, RAM or Internet connection. While that is running, I find that I want to run a similar command. Let's say downloading something ...
2
votes
1answer
66 views

Conditionals for fish shell

I am going through the fish shell tutorial and find that this simple if-else block does not work if grep fish /etc/shells echo Found fish else if grep bash /etc/shells echo ...
0
votes
1answer
134 views

How to use booleans in fish shell?

I switched to fish shell and quite happy with it. I didn't get how can I handle booleans. I managed to write config.fish that executes tmux on ssh (see: How can I start tmux automatically in fish ...
1
vote
1answer
590 views

How can I start tmux automatically in fish shell while connecting to remote server via ssh

I switched from bash to fish shell. I liked it and decided to use it on my servers also. How can I start tmux automatically on ssh connection? I followed this instruction for bash but fish shell is ...
4
votes
1answer
81 views

Is there a command to move a file, and symlink it back to where it was?

I often find myself wanting to move a file, then create a symlink where it was. In doing this by hand I tend to twist my mind. (Esp after doing half a dozen files) Use cases: Moving all my "dot ...
3
votes
1answer
77 views

Show completions under the prompt in Fish

Is there a way I can get the ultra compact auto-complete function from Zsh in Fish, so If I press Tab it won't write me all the possibilities permanently into my terminal but underneath the prompt?
3
votes
1answer
712 views

Converting bash script to fish

I'm trying to add the following bash scripts to fish, yet am having trouble getting the syntax in fish right. Here is the original script: export MINION_INSTALL=$HOME/minion export ...
1
vote
1answer
148 views

Adding pass completion to fish shell

I'm trying to get the CLI password manager pass to work in my fish shell with auto completion. I've already found the necessary file on GitHub, yet am having trouble finding out where to put it, or ...
15
votes
1answer
667 views

Does Bash have similar features such as Fish's autosuggestions and highlighting?

I recently noticed 2 features in Fish and was wondering if anyone knew if these were also available in Bash? Syntax highlighting Specifics: You'll quickly notice that fish performs syntax ...
3
votes
3answers
900 views

How do I create a GUI application launcher for xfce4-terminal with fish but inheriting the environment variables from bash?

If I run fish from a bash prompt, it will inherit the environment variables I have set in my .bashrc and .profile files, including the important $PATH variable. So far so good. Now, I want ...
1
vote
1answer
208 views

Is it possible to have comments in multiline commands in fish?

In bash it's possible to do my_function() { echo "hello" | #remove 'l' tr -d 'l' } but in fish ( http://fishshell.com ) I wasn't able to do the same: function my_function echo "hello" | ...
12
votes
2answers
3k views

Make zsh completion show the first guess on the same line (like fish's)

In Fish when you start typing, autocompletion automatically shows the first autocompleted guess on the line itself. In zsh you have to hit tab, and it shows the autocompletion below. Is there anyway ...
5
votes
1answer
545 views

command substitution handling in fish vs. other shells (sh, bash, zsh)

The program mc (Midnight Commander) is not intended to be used for command substitution, but I would like to know why different shells behave differently when this program (and it seems like other ...
2
votes
1answer
252 views

how do I reference a variable in fish shell with a default fallback

What is the fish shell equivalent to the following bash: echo ${TEST:-1} In bash this would print the value of TEST if there was one, or 1 if there was not.
1
vote
4answers
938 views

Get default ubuntu motd in fish shell

I would like to have Ubuntu's MOTD in the fish shell. Ubuntu's default is as follows: That is essentially what I would like to see when open up my terminal (terminator, which loads fishfish) As ...
2
votes
0answers
601 views

kio sftp does not work but fish works

If I try to initiate an sftp connection from dolphin (or konquerer), it tells me the password is wrong and asks me for the correct password. Incorrect username or password Do you want to retry? ...
3
votes
1answer
127 views

Print tab character in fish

In bash I could either do echo -e "a\tb" or echo a$'\t'b. How do you do this in fish?
1
vote
1answer
74 views

Quoting command substituted value

In bash you would do touch "foo bar" rm "$(echo foo bar)" How would you do that in fish? This doesn't work for obvious reasons: touch "foo bar" rm "(echo foo bar)"
4
votes
1answer
299 views

What's the fastest (CPU time) way to get my current git branch?

I'm trying to improve the performance of my fish prompt, and since my prompt includes my current git branch, I'm wondering if there may be a way to make it faster. Right now I'm using git ...
22
votes
7answers
28k views

Execute a command once per line of piped input?

I want to run a java command once for every match of ls | grep pattern -. In this case, I think I could do find pattern -exec java MyProg '{}' \; but I'm curious about the general case - is there an ...
3
votes
1answer
189 views

Does Fish have a “magic space”?

I gather that bash has a "magic space" function, where if I do e.g. sudo !!<space> it will blow in sudo ./my_last_command. Does something similar exist in fish?