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 votes
2 answers
675 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.
user avatar
  • 2,025
1 vote
1 answer
225 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....
user avatar
  • 9,062
4 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 ...
user avatar
  • 203
1 vote
1 answer
906 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:...
user avatar
  • 13
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/...
user avatar
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
2 votes
1 answer
1k views

problem in login with default /bin/fish shell in gdm

I set fish as default shell for my user in Linux. /etc/passwd file: mlibre:x:1000:1000::/home/mlibre:/bin/fish and now, in GDM I can't login with my user (mlibre). GDM prints some error. I turned ...
user avatar
  • 1,199
2 votes
1 answer
292 views

Programs don't see fish environment variables

If I set the EDITOR environment variable to emacs in bash, running crontab -e will open the crontab in emacs. When I set it in fish with set -U EDITOR emacs crontab opens with vim. What can I do to ...
user avatar
  • 9,062
9 votes
2 answers
797 views

xtrace equivalent in the fish shell

Is there an equivalent of POSIX shells' set -x or set -o xtrace that cause the shell to display the commands being run in the fish shell?
user avatar
3 votes
3 answers
936 views

Fish shell slow to respond when command does not exist

When I write a command that does not exist in the fish shell (let's say l instead of ls), fish takes some time before responding that the command does not exist. I don't know if it looks for package ...
user avatar
  • 393
9 votes
4 answers
8k views

fish: sudo: !!: command not found

I have fish installed in my Linux Mint DE. I really like how fish makes things easier and it looks so pretty although I haven't find a correct answer about why I can't execute: sudo: !!: command not ...
user avatar
  • 2,881
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
4 votes
3 answers
797 views

fish: whitespace in alias

I am trying to alias an executable in a directory with a space in it. For example: alias myfile="/home/ben/test case/myfile" Now, this is not expanded the way I want (it thinks /home/ben/test is the ...
user avatar
  • 143
5 votes
1 answer
770 views

Why does the fish shell need to start a daemon process?

I just started playing with the fish shell, and I really like is so far. However, I can't figure out what the purpose of fishd is. So, why does fish need to start up a daemon process? What is the ...
user avatar
  • 437
2 votes
1 answer
82 views

fish + script -> chaos, what options?

The fish shell uses many escape sequences as you type, especially if you ever make a mistake or use completion. 'script' just captures them literally, making quite a mess. More of a mess than col -b ...
user avatar
10 votes
2 answers
27k views

How to edit the fish shell startup script?

Is there a way I can do something like run myscript.sh in fish ? I am using Arch Linux, and have installed the fish shell together with oh-my-fish Can someone tell me which file I must edit to add ...
user avatar
  • 203
3 votes
1 answer
451 views

Can't seem to set environmental variables in fish correctly?

this is my fish configuration: set -x CGO_CPPFLAGS 'llvm-config --cppflags' set -x CGO_LDFLAGS 'llvm-config --ldflags --libs --system-libs all' set -x CGO_CXXFLAGS '-std=c++11' I've tried running ...
user avatar
1 vote
0 answers
2k views

$PATH variable on Fish Shell OS X

I have somehow screwed up my path variables with Fish shell on OS X. Is this the proper $PATH variable in the config.fish? user@host ~> more ~/.config/fish/config.fish set -g -x PATH /usr/local/...
user avatar
8 votes
2 answers
4k views

In the Fish shell, how can I join an array with a custom separator?

I have an array whose elements may contain spaces: set ASD "a" "b c" "d" How can I convert this array to a single string of comma-separated values? # what I want: "a,b c,d" So far the closest I ...
user avatar
  • 5,141
1 vote
2 answers
186 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.9k
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,141
17 votes
5 answers
18k views

What's the easiest way to detect what signals are being sent to a process?

I'm trying to debug an issue with my shell (specifically, fish) sending signals to my background processes. I'd like to be able to recognize what signals a process is receiving. Ideally, I'd like ...
user avatar
2 votes
0 answers
336 views

vf project in fish shell

I am using virtual fish on fish shell, so while trying to do vf project projectName it throws the below error: vf project pytube fish: Unknown command 'virtualenv' /Users/userName/clones/...
user avatar
3 votes
1 answer
660 views

launching fish shell to new terminal of tcsh on centos

I have downloaded fish shell on my centos, but when I switch command to /bin/fish or even try to run xterm -e /bin/fish I am getting following error: Standard input: echo $_ " "; __fish_pwd ...
user avatar
2 votes
2 answers
350 views

Custom bash 'context' when running from FISH

First of all, I'm on OSX10. My default shell is BASH, which I have set up (through .profile and .bashrc) to automatically run the FISH shell when I open my terminal emulator. This allows me to set up ...
user avatar
3 votes
2 answers
732 views

Why doesn't set -x work within eval within a function in fish?

I ran into an issue trying to dynamically set some variables based on output of a program, in a fish function. I narrowed my issues down to a MWE: function example eval (echo 'set -x FOO 1;') ...
user avatar
2 votes
0 answers
1k views

Unable to create a configuration directory for [FishShell] Please set the $XDG_CONFIG_HOME variable

I'm getting this error when starting fishshell: melanie:~ melanie$ fish fish: Unable to create a configuration directory for fish. Your personal settings will not be saved. Please set the $...
user avatar
  • 21
23 votes
7 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,511
29 votes
10 answers
4k views

Dealing with file names with special first characters (ex. ♫)

I have recently come across a file whose name begins with the character '♫'. I wanted to copy this file, feed it into ffmpeg, and reference it in various other ways in the terminal. I usually auto-...
user avatar
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 ...
user avatar
  • 847
1 vote
2 answers
440 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 ...
user avatar
5 votes
1 answer
268 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 ...
user avatar
  • 371
2 votes
2 answers
918 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 ...
user avatar
  • 151
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
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
3 votes
1 answer
809 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 ...
user avatar
  • 551
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
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
5 votes
1 answer
701 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 ...
user avatar
3 votes
1 answer
502 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?
user avatar
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/...
user avatar
  • 177
5 votes
1 answer
1k 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 ...
user avatar
  • 177
55 votes
3 answers
26k 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
  • 346k
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-...
user avatar
  • 5,141
4 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" | \ ...
user avatar
47 votes
3 answers
53k 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,751
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 ...
user avatar
20 votes
2 answers
7k 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.
user avatar
  • 301
4 votes
5 answers
3k 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 ...
user avatar
  • 154
4 votes
1 answer
595 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?
user avatar
  • 5,511