Questions tagged [fish]

The fish shell is an alternate shell, and scripting language, for *nix systems (including macOS). Its claim to fame is being an intuitive, user friendly, and efficient modern shell. Some key examples, per their own website, are enhanced syntax highlighting, completions and autosuggestions (automatically generated from man pages), high performance, and sane scripting.

Fish is a command-line shell designed to be both smart and user-friendly, with auto-suggestions, fully 256 color support, and web-based configuration. Packages for Fish exist for macOS and various flavors of Unix.

Features that differentiate it include rich syntax coloring, auto-completion of commands and arguments, and a high-performance, multithreaded implementation.

Resources

991 questions
52
votes
10 answers

Open a folder in Sublime Text 3 using command line

I'm trying to open a directory in sublime Text 3. I can launch sublime from the command line using the subl command. The help text show the following: Sublime Text build 3059 Usage: subl [arguments] [files] edit the given files or: subl…
Ismail Moghul
  • 2,864
  • 2
  • 22
  • 28
51
votes
3 answers

How to access remaining arguments in a fish script

my-fish-script a b c d Say you want to get the all arguments from the second argument onwards, so b c d. In bash you can use shift to dump the first argument and access the remaining ones with "$@". How would you solve the problem using the fish…
Dennis
  • 56,821
  • 26
  • 143
  • 139
49
votes
2 answers

Why & How fish does not support POSIX?

I have heard about fish that it's a friendly and out-of-box shell but also it doesn't support POSIX standard. On the other hand I read about POSIX standard (and also I tested it on my Fedora, It's amazing and out-of-box shell now I want to change…
Cy8099
  • 623
  • 1
  • 5
  • 10
45
votes
4 answers

PS1 prompt in fish (Friendly Interactive SHell) show git branch

In Bash I have my PS1 as PS1="\u@\h:\w\$(git branch 2>/dev/null | grep -e '\* ' | sed 's/^..\(.*\)/{\1}/') \$ " Which will show my current git branch if I am in a git repo. How do I set the PS1 in fish so it will show me my current git branch?
Alexandre Santos
  • 8,170
  • 10
  • 42
  • 64
43
votes
1 answer

Fish shell - How to interpolate a subcommand?

In bash I can say: $ echo "a$(echo b)c" abc How do I do this in the fish shell?
Joshua Cheek
  • 30,436
  • 16
  • 74
  • 83
39
votes
6 answers

Add a relative path to $PATH on fish startup

I want to add ./bin directory (which is relative to current shell directory) to $PATH on fish startup. Note that fish is a shell. echo $PATH set PATH ./bin $PATH echo $PATH If I place these lines inside ~/.config/fish/config.fish the shell will…
Simon Perepelitsa
  • 20,350
  • 8
  • 55
  • 74
38
votes
6 answers

Fish Interactive Shell full path

Is there a way in the Fish Interactive shell for the full path to be displayed. Currently when I navigate to a directory I get the following shell. millermj@Dodore ~/o/workspace but I would rather see millermj@Dodore ~/o-town/workspace
Milhous
  • 14,473
  • 16
  • 63
  • 82
37
votes
3 answers

Cannot run source activate with conda in Fish-shell

I follow conda_PR_545, conda issues 4221 and still not working on Ubuntu. After downloading conda.fish from here, and mv it to anaconda3/bin/. Add "source /home/phejimlin/anaconda3/bin/conda.fish" at the end of ~/.config/fish/config.fish. conda…
Jim
  • 1,550
  • 3
  • 20
  • 34
37
votes
1 answer

Brace expansion with range in fish shell

In bash, I can do the following $ echo bunny{1..6} bunny1 bunny2 bunny3 bunny4 bunny5 bunny6 Is there a way to achieve the same result in fish?
workflow
  • 2,536
  • 2
  • 14
  • 11
36
votes
1 answer

How do I change the colour of directory listings with oh-my-fish?

I've recently decided to give the fish shell a shot and also started using oh-my-fish. The problem I'm having is that I can't figure out how to change the color of directory listings when running a command such as ls. The picture attached below…
Paymahn Moghadasian
  • 9,301
  • 13
  • 56
  • 94
35
votes
4 answers

Fish Shell: How can I customize the colors for the autocomplete feature?

I started using Fish (and oh-my-fish) a couple of weeks ago and one of the things that I find somewhat visually hard is the default background color of the autocomplete options (see the purple background in the image). I tried looking in the Fish…
Roberto S.
  • 1,262
  • 1
  • 14
  • 19
34
votes
1 answer

Check if a program exists from a Fish script

How can I check if a program exists within a fish script? I know that there is no absolute solution with Bash, but using if type PROGRAM >/dev/null 2>&1; then... gave good results. Is there something similar with fish?
azmeuk
  • 4,026
  • 3
  • 37
  • 64
34
votes
5 answers

Fish shell: Check if argument is provided for function

I am creating a function (below) with which you can provide an argument, a directory. I test if the $argv is a directory with -d option, but that doesn’t seem to work, it always return true even if no arguments are supplied. I also tried test -n…
user14492
  • 2,116
  • 3
  • 25
  • 44
33
votes
6 answers

AWS CLI command completion with fish shell

Has anybody been able to set up auto-complete for the AWS CLI with fish shell? The AWS documentation only offers the guide for bash, tcsh, and zsh. Bash exports the variables COMP_LINE and COMP_POINT that is used by the aws_completer script provided…
Osi
  • 331
  • 3
  • 5
33
votes
3 answers

On OS X, how do I change my shell from fish back to bash?

I'm kinda preferring bash lately to fish, and I'm wondering if I can change it back. I tried this command: chsh -s /bin/bash but closing the terminal and reopening it does not restore it to bash, but it's still fish. In fact, how do I remove fish?
Doug Smith
  • 29,668
  • 57
  • 204
  • 388
1
2
3
65 66