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

learn more… | top users | synonyms

2
votes
1answer
31 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
22 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
54 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
60 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
36 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?
2
votes
1answer
78 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
29 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 ...
10
votes
1answer
209 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
225 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
97 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" | ...
8
votes
2answers
692 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
376 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
108 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
3answers
693 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
470 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
84 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
65 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
250 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 ...
18
votes
6answers
17k 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 ...
2
votes
1answer
172 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?