Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

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
245 votes
12 answers
289k 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 ...
user avatar
  • 3,333
55 votes
3 answers
25k 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 ...
user avatar
  • 345k
44 votes
3 answers
52k 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 ...
user avatar
  • 1,701
22 votes
6 answers
10k views

Share environment variables between bash and fish

bash and fish scripts are not compatible, but I would like to have a file that defines some some environment variables to be initialized by both bash and fish. My proposed solution is defining a ~/....
user avatar
  • 5,441
2 votes
1 answer
751 views

Fish shell shows dark-grey "âŽ" characters in prompt

I'm pretty certain this is some foible of my SSH client (RoyalTS for Windows) but, having just installed and changed to fish shell, my prompt is preceded by two dark-grey ⎠characters. It doesn't ...
user avatar
2 votes
3 answers
2k 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 ...
user avatar
5 votes
1 answer
485 views

Shell that tab-completes prefix?

I would like tab completion to behave differently when the cursor is at the beginning of a word than when the cursor is at the end of a word. I've only ever seen shells that tab-complete the suffix, ...
user avatar
5 votes
3 answers
3k views

Is it possible to exec some commands in a subshell without immediately exiting afterwards?

I use the fish shell and would like to be able to "source" some shell scripts written with sh-compatible syntax, which fish cannot read. For example lots of software expects you to source some shell ...
user avatar
  • 5,041
4 votes
1 answer
2k 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 ...
user avatar
  • 487
3 votes
1 answer
630 views

Issues with scp if I use bashrc to open fish if present

Situation: Need to login to multiple remote servers with some of them having fish shell Requirement: Default shell is bash. If I login to a server and fish is present, switch to fish shell, otherwise ...
user avatar
  • 63
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 ...
user avatar
  • 487
3 votes
2 answers
2k 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: ...
user avatar
3 votes
3 answers
2k views

Gnome-terminal custom command and dynamic working directory

This is kind of a followup to another question. I use a custom command in my gnome-terminal profile (/usr/bin/fish). When using Ubuntu 14.04 a Ctrl-Shift-N opened a new gnome-terminal window in the ...
user avatar
  • 151
17 votes
1 answer
3k views

Run a command only if the previous command was successful in Fish (like && in bash)

Using Bash I've often done things like cd /study && ls -la I understand that the double ampersand is telling the terminal don't execute part two of this command unless part one completes ...
user avatar
  • 410
8 votes
3 answers
8k views

fish shell : exec format error

On an Ubuntu ($ uname -a : Linux kumanaku 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux), I just installed fish ($ fish --version : fish, version 2.7.1) ...
user avatar
3 votes
2 answers
5k views

Fish Shell: How to set multiple environment variables from a file using export

Is it possible to set environment variables with export in Fish Shell? I am working on a project that configures variables this way and it does not make sense to maintain a separate configuration ...
user avatar
1 vote
2 answers
184 views

Accessing fish functions from perl

In bash I can do: foo() { echo bar; } export -f foo perl -e 'system "bash -c foo"' I can also access the function definition: perl -e 'print "foo".$ENV{"BASH_FUNC_foo%%"}' How do I do the same in ...
user avatar
  • 29.7k
1 vote
2 answers
274 views

Why 'kill -l' gives different output in fish and bash

I was using fish-shell when reading about kill command. The output of kill -l command for fish is HUP INT QUIT ILL TRAP ABRT IOT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM .... When invoking same command ...
user avatar
1 vote
0 answers
2k views

Unable to execute bash scripts from within fish-shell

I have a collection of bash scripts that I have added to the PATH so that I can execute them from anywhere. export PATH=$PATH:~/<path>/<to>/<scripts> so along with ./<path>/&...
user avatar
0 votes
3 answers
1k views

TMUX and terminal colors are not the same locally and over ssh

I have a bunch of dotfiles that allow me to have a pretty theme on my terminal and tmux on my local host. I use kitty, fish and tmux. To properly define colors and have a global coherence, I use the ...
user avatar
  • 101