Questions tagged [fish]
Fish is a unix shell with a clean design and a limited but powerful feature set.
199
questions
3
votes
4
answers
3k
views
shell command `tmux` throws `can't use /dev/tty` error
I just switched from using terminator to termite today. I also Installed Fish and oh my fish, Spent a couple hours configuring everything, but when I went to start a tmux session to get some work ...
3
votes
1
answer
2k
views
Is $argv in fish shell different from $@ in bash?
I was trying to learn and write some fish scripts, but I encountered a strange issue.
# a.fish
# this is a fish script
set temp (getopt -o abc -l ace,bad,correct -- $argv)
echo $temp
When I ran ...
15
votes
2
answers
7k
views
Why can't I list a directory with read permissions?
I created a directory d and a file f inside it. I then gave myself only read permissions on that directory. I understand this should mean I can list the files (e.g. here), but I can't.
will@wrmpb /p/...
3
votes
1
answer
4k
views
Using ~/.dircolors in fish shell
I just recently switched to the fish shell from bash and I am having trouble sourcing my dircolors template file to get custom colors to appear for certain file extensions.
In bash, I was sourcing a ...
17
votes
1
answer
8k
views
How to change the default shell in NixOS?
At the moment I need to set the fish shell to be my default shell on NixOS and there is no official documentation on how to do that declaratively (not by running chsh) in NixOS.
2
votes
2
answers
1k
views
Capture stdout and stderr as separate variables in fish shell
Is this even possible?
I'd like to run a command but capture its stdout and stderr as separate variables. Currently I'm using set -l var (cmd), which leaves stderr untouched. I can do set -l var (cmd ...
2
votes
1
answer
497
views
How can one override bash Ctrl+C to be more fish-like
I find myself using bash more often than not on remote machines even though fish is my preferred shell. Fish has small, but nice feature that when you hit Ctrl+C something like this happens:
if ...
1
vote
2
answers
861
views
debian 9 terminal cannot change to su
I installed debian stretch yesterday. I installed fish shell . I change the default shell to fish by the following
su chsh -s 'which fish'
Then again enter the this command
su chsh -s `which fish`
...
3
votes
0
answers
810
views
How can I send stdout to multiple commands in fish shell?
Same question as How can I send stdout to multiple commands? but for fish shell.
3
votes
2
answers
3k
views
Start bash then autostart fish with terminator
I've been using terminator, and recently started using fish. When terminator starts (bash) I can use, for example, node just fine. If I then start fish I can still run node just fine.
I set ...
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 ...
10
votes
1
answer
7k
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 ...
1
vote
1
answer
890
views
Remap Ctrl+E to autocomplete file names in fish
I'm using Fish shell on Urxvt terminal.
I want to map Ctrl+E as auto-completion key, what is done by pressing Right arrow key by default.
I'm not sure if it's shell's or terminal's feature to do so, ...
-1
votes
1
answer
125
views
Fish Shell - function name conflicts with apt package in Ubuntu [closed]
I have created a fish function named proot but there is an Ubuntu package with the same name.
When I type 'proot' into my fish shell, I get
~> proot
The program 'proot' is currently not ...
2
votes
2
answers
2k
views
Ctrl Right and Ctrl Left doesn't move from a word to another in Fish Shell
When I use on Linux Mint my Fish Shell, using the Ctrl-← or Ctrl-→ keys isn't moving the cursor to the previous or next word. It switches between an I and an N instead:
I cannot do ...
1
vote
1
answer
555
views
Looking for fish theme with powerline, full path and return and carriage return after the prompt line
I'm looking for a theme I noticed some time ago and that I can't find again, it was a theme on fish or zsh where the prompt line (user & path) had powerline theme, the full path was displayed and ...
2
votes
0
answers
280
views
History expansion in fish
I want to run the previous command with part of it replaced. In bash, I can use the history expansion feature: ^x^y runs the previous command again, except with x replaced by y. I tried it in fish and ...
2
votes
0
answers
110
views
Printing autocomplete info on current option in fish shell
When writing a command with a - option and pressing tab, a list of possible completions with short explanations of what the options do is displayed. Is there a way to make this list also contain the ...
2
votes
1
answer
522
views
How to unmap keys in fish?
I want to unmap (unbind) certain keys such as Up, Down, Left, Right, Page Up, Page Down, Home, End specifically in the fish shell.
I guess I have to use the bind command in the .config/fish/fish....
2
votes
2
answers
315
views
Quoting and concatenating a fish function argument
I keep destroying and provisioning VMs, so ssh frequently complains that I'm being NASTY. Mmmm...
Anyways, I wrote a fish function to banish the offending key on the line it tells me with sed:
...
0
votes
1
answer
799
views
check a range with switch/case in fish shell
Is something like this possible with fish? i.e.
switch $var
case a-z
do something
case "*"
do something else
end
case "*"works fine, but case a-zdoesn't trigger.
I also tried case [ a-z ...
2
votes
3
answers
2k
views
Windows bash takes arrows as symbols via ssh and fish shell on server
I have a bit complicated question. I am using Windows 10 Anniversary Update with Bash for Ubuntu. I am connecting to server via ssh. This server uses fish shell. And when I press arrows it just prints ...
4
votes
1
answer
1k
views
Fish shell testing for existence of file in $PATH
I'm trying to test in a fish shell script for the existence of the figlet binary. Since I use Linux and OS X I cannot rely on the file being in the same location and need to resolve it dynamically. I'...
1
vote
1
answer
561
views
Output pipe waits for EOF in fish [closed]
I'd like to take the csearch output and color it. It looks like so:
/home/bp/whatever.txt:1:foo
And this works:
csearch -n -- $term \
| env GREP_COLORS='mt=02;35' grep --color=always -P '^[^:]+:[^...
1
vote
0
answers
105
views
Internal path not set in GVim when launched from gvim.desktop
shell: bash, fish
terminal: xfce4-terminal
other-applications: xfce4-whiskermenu, tmux
I'm trying to have GVim inherit the full path from bash and/or fish when launching from from xfce-whisker-menu....
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 ...
8
votes
3
answers
2k
views
find -exec not working in fish
While using fish as my shell, i'm trying to set permissions on a bunch of c source files in current dir with
find . -type f -name "*.c" -exec chmod 644 {} +;
I get an error
find: missing ...
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 ...
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, ...
1
vote
1
answer
1k
views
Can I open terminator with one windows with bash and another with fish? [duplicate]
So I am running terminator 0.98. I like fish shell but for some task it is handy to have bash (like for virtualenvwrapper). So I now have two windows that open when I start terminator. But I would ...
8
votes
1
answer
5k
views
Run fish script in background? [closed]
I'd like to always run a fish script in the background even if the user doesn't specify that.
In bash, this can be done by surrounding the script with ( at the start and ) & at the end.
Is there ...
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 ...
0
votes
2
answers
4k
views
Insert/overwrite mode in fish
I'm using Linux Mint on a MacBook and on its keyboard the equivalent for the INSERT key is the combination Fn + RETURN.
At the moment I can only see the intended behavior of this combination in GNU-...
0
votes
1
answer
650
views
fish: Unknown command "abbr"
Fish is not recognizing the abbr command.
fish: Unknown command “abbr”
abbr: command not found
In all other ways fish is behaving normally.
The Fish documentation doesn't give any clues as to why ...
2
votes
1
answer
409
views
Fish Wrap all commands in a function
I have a function that is setup to send status updates to anybar.
function e --description 'Run command' \
--argument-names command
anybar yellow; eval $command; anybar green;
end
I am ...
1
vote
2
answers
2k
views
Why there isn't a number of the command and a timestamp for fish?
In fish, when I type history | less I see the following for example:
history | less
export HISTTIMEFORMAT="%h/%d - %H:%M:%S "
bash
in bash I see this:
491 18/04/16 14:31:02 cd
492 18/04/16 ...
1
vote
1
answer
480
views
Command substitution with pkg-config in Fish
Fish's command substitution is supposed to be the equivalent of Bash's $() yet this simple example fails:
g++ -std=c++14 -Wall -Wextra -pedantic -g (pkg-config --cflags sdl2) \
test.cpp (pkg-...
0
votes
1
answer
354
views
how to bind a command when fish shell is started
Instead of using !! in bash, I am using a function to prepend sudo after a key combination.It seems the only way to use it is to bind the key every time a new shell is created. I have tried putting
...
0
votes
1
answer
66
views
Is there a Fish Function I can make to eliminate leading "$"/"#" from commands copied from sites?
Sometimes when I'm copying and pasting a command from a site, I accidently copy the leading "$" or "#" by accident. Is there a Fish Function I could make that would check if one of those is included ...
13
votes
2
answers
11k
views
Fish-Shell Will Not Save my Aliases
I do not know why, but after making a whole bunch of fish aliases. I'm assuming I have neglected one simple step after assigning them all but I cannot seem find the solution myself.
Can anyone lend ...
6
votes
1
answer
3k
views
How can I check if a shell is login/interactive/batch in fish?
I want to be able to check if a fish shell is being run in login, interactive, or batch mode, and this question only discusses bash.
0
votes
2
answers
54
views
Why does the command not exit smoothly?
Following on from my previous question I tried to run ls -l; and grep html; which did what I wanted however the command didn't exit back to the prompt. Instead it appeared to be waiting for something ...
2
votes
1
answer
205
views
Why does this fish script does not run from a launcher?
I've written the following script, intended to start a daemon and display a Zenity window, then stop the daemon when the window is closed:
#!/usr/bin/fish
if not ps aux | grep [s]erviio > /dev/...
2
votes
0
answers
140
views
Is there a way to determine from bash what is wrong with fish?
Just installed oh-my-fish and start modifying oh-my-fish default theme under another name and broke something.
Now after login the cursor just blinks and I can write but nothing is interpreted as ...
4
votes
1
answer
1k
views
How to stop fish shell from underlining path?
The fish shell will underline a path given as an argument to a command such as ls. Is there a way to change that behavior since I find it very ugly?
For example:
-1
votes
2
answers
663
views
How to set 256colors in xfce4-terminal 0.6.3 that is using the fish shell, always for all users
How to set 256colors in xfce4-terminal 0.6.3 that is using the fish shell, always for all users ? Can't find this info anywhere and it's getting hard.
1
vote
1
answer
223
views
How can I mix variables and wildcards in fish?
I have a value stored in a variable that I want to use as part of a wildcard, like this:
set extension (somecommand)
cp *$extension ~/filezone
But the * prevents the variable from being dereferenced....
3
votes
1
answer
5k
views
Execute bash command inside fish function
I decided to try fish shell, and I'm having trouble with some aliases. So I guess the painless way of doing the things would be executing the bash commands inside fish shell functions. Something like ...
1
vote
1
answer
900
views
Scripting SSH function getting `Connection refused` error
I am using fish as shell, ssh shortcut function as following:
function sshec2
ssh -i $HOME/.ssh/key.pem -t -t "ubuntu@$argv[1]"
end
To ssh into specific AWS EC2 instance, I wrote command pipe flow:...
0
votes
1
answer
1k
views
Can't set my shell as fish shell due to error when using chsh due to lock file [closed]
My problem: I cannot set my default shell for user 'student' on CentOS 7 to fish-shell. I installed fish-shell by downloading the .gz, configuring, make, make install.
output of which fish
/usr/...