Questions tagged [fish]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
1k 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 ...
  • 907
1 vote
2 answers
453 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 ...
5 votes
1 answer
317 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 ...
  • 371
2 votes
2 answers
992 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 ...
  • 151
3 votes
2 answers
3k 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
3 answers
3k 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 ...
3 votes
1 answer
873 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 ...
  • 551
4 votes
1 answer
3k 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 ...
  • 497
3 votes
2 answers
5k 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 ...
  • 497
5 votes
1 answer
722 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
1 answer
526 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?
4 votes
1 answer
5k 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 NOTES_HOME=$HOME/...
  • 187
5 votes
1 answer
2k 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, yet am having trouble finding out where to put it, or rather ...
  • 187
59 votes
3 answers
31k 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 ...
  • 358k
4 votes
4 answers
5k 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 xfce4-...
  • 5,353
5 votes
1 answer
2k 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" | \ ...
48 votes
3 answers
56k views

How to 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 ...
  • 1,781
4 votes
1 answer
2k 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 ...
21 votes
2 answers
8k 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.
  • 311
4 votes
5 answers
4k 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 far ...
  • 154
5 votes
1 answer
629 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?
  • 5,761
1 vote
1 answer
152 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)"
  • 5,761
5 votes
1 answer
868 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 symbolic-...
264 votes
12 answers
308k 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,553
3 votes
1 answer
335 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?
  • 3,553

1 2 3 4
5