Questions tagged [fish]
Fish is a unix shell with a clean design and a limited but powerful feature set.
22
questions
271
votes
13
answers
319k
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 ...
62
votes
3
answers
34k
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 ...
50
votes
3
answers
58k
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 ...
25
votes
7
answers
12k
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 ~/....
3
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 ...
2
votes
1
answer
870
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 ...
0
votes
1
answer
321
views
Terminal prompts have a mysterious [I] in it
I have been using fish shell for a while, but only recently got into playing around with the oh-my-fish framework and theming the prompt.
I cannot figure out what this [I] character means! In most ...
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 ...
11
votes
2
answers
10k
views
How does history work in fish shell?
I'm a bash user, starting a new job at a place where people use fish shell.
I'm looking at the history command which I often use in bash. When I use it in fish I get a long list of my history which ...
8
votes
3
answers
10k
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) ...
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 ...
5
votes
1
answer
555
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, ...
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 ...
4
votes
3
answers
6k
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
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 ...
3
votes
2
answers
6k
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 ...
3
votes
1
answer
773
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 ...
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:
...
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>/&...
1
vote
2
answers
314
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 ...
1
vote
2
answers
199
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 ...
0
votes
3
answers
3k
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 ...