Questions tagged [fish]

The friendly interactive shell (fish) is a Unix shell that focuses on interactive use, discoverability, and user friendliness.

Filter by
Sorted by
Tagged with
2 votes
2 answers
2k views

Failed to login after setting fish as default shell

I tried fish for a while, and then i wanted to set it as my default shell. I edited /etc/passwd and changed the shell of my user to /bin/fish. The problem is I couldn't login anymore. I tried through ...
0 votes
1 answer
289 views

Fish commandline: get cursor position in current process

With fish commandline command I can get current process part of commandline and current cursor position in entire buffer, but not in current process, e.g for commandline buffer > echo test; echo $...
101 votes
2 answers
34k views

chain Fish commands via `&&` or `||`

In Bash/ZSH and other shells, I am used to using && and ||. Is there any equivalent in Fish?
0 votes
1 answer
1k views

How can I fix this error when trying to install Oh-My-Fish?

I am using fish via Cygwin on Windows 10; whenever I try to install OMF, I am presented with this error: curl -L https://get.oh-my.fish | fish.exe % Total % Received % Xferd Average Speed ...
1 vote
2 answers
1k views

Using rbenv with the fish shell

When using the recommanded way to setup rbenv, `eval "$(rbenv init -)", I get: $(...) is not supported. In fish, please use '(rbenv)'. ~/.config/fish/config.fish (line 5): eval "$(rbenv init -)" ...
6 votes
2 answers
2k views

Fish terminal + iTerm, only run shell integration if terminal is iTerm

iTerm has a shell integration script that enables some fancy features, as in having the ability to scroll up to last prompt (in case if there was a lot of stdout i.e. when compiling some code). ...
2 votes
1 answer
906 views

Wrap command with options in fish function

Is there a way to wrap a command with options in a function, so that completions for that command with the options are shown? For example, I want to be able to do this: function remove --wraps='...
1 vote
1 answer
184 views

Setup different path for fish shell temporally

User libraries are normally in /usr/local/lib. However I want to build some third party libraries in for example /Users/user/Public/lib. I only want to do it during my testing. Is there a elegant way ...
11 votes
3 answers
10k views

How to get Fish shell and NVM both installed with Homebrew to work together?

I am trying to manage my packages for OSX using Homebrew as much a I can. I have installed both the Fish Shell and NVM using Homebrew but cannot get Fish to recognize my NVM installation. NVM ...
21 votes
3 answers
16k views

How do I change EDITOR to be Pico in fish shell?

I can’t get Mercurial (hg) to use pico as my EDITOR when I’m using fish shell. I’ve tried using this and other variations, but nothing seems to help: set -U EDITOR pico hg commit will always open ...
2 votes
1 answer
673 views

how to open tcp connection in fish shell

I am looking for a way to open TCP connections in fish shell. In bash, I can do the following to open a TCP connection. This is quick telnet type test when telnet is not installed. $ echo > /dev/...
1 vote
1 answer
1k views

Difference between set -g and set -x

I'm currently migrating from bash configs over to fish and got stuck translating my over bash exports. It seems there's three ways to do it in Fish that get the job done but I can't tell which one I ...
1 vote
0 answers
93 views

fish shell, enter long command

Given the usual size of the terminal window, short commands fit. Ex: stoqlt@desktop:~ > ls files However, typing a command that is longer than the free space after the prompt, and reaching the end ...
3 votes
1 answer
16k views

How can I setup fish shell prompt to be in a different color?

I've seen a screenshot of zsh configured to have prompt with a different color and background, and it looks like a very usable tweak:
1 vote
1 answer
178 views

Issue with wrong command entered in fish-shell and it's output

Actually I am using fish these days and I completely switched from bash to fish (with chsh & terminal startup command) but the matter is when I enter a wrong command e.g. qwerty its output is: ...
5 votes
2 answers
6k views

Change prompt on command line?

My prompt is quite verbose - which is good most of the time - but now I would like to switch it temporarily because I want to make a screen shot of the terminal. For that purpose I would prefer not to ...
0 votes
1 answer
319 views

How to start a fish instance with a specific `config.fish`?

I want to start a particular fish instance with a specific config.fish. Something along the lines of the Bash --rcfile option. I'm aware of the XDG_CONFIG_HOME variable. But I just want to switch ...
3 votes
2 answers
3k views

What's causing the file is not executable by user on the windows subsystem for linux?

This seems to have randomly started a few days ago. It used to be fine to run fish shell from Ubuntu bash for Windows. But suddenly when I hit Tab for autocomplete, it barfs with: The file "x86" is ...
0 votes
1 answer
470 views

Fish shell doesn't return program error

In bash, if I run a program and it crashes I get some information about what went wrong, such as Segmentation fault (core dumped). In fish, I just get fish: but no message... does anyone know what the ...
1 vote
1 answer
224 views

Two questions about adding custom content to config.fish

I have a question about the Fish (Friendly Interactive SHell), so I hope somebody can help me out. Basically I'd like to customize the fish_greeting message. I can easily get it to say anything I'd ...
0 votes
1 answer
1k views

Reveal user@hostname in oh-my-fish theme

I'm trying to have the user@hostname displayed all the time in fish's bobthefish theme, no matter whether you're the default user or not. I've tried editing ~/.config/fish/functions/fish_prompt.fish, ...
19 votes
1 answer
13k views

How to keep terminal window title in sync with tmux window

I am using a program called "Timing" to track my time. Timing uses the name of the current window in iTerm for categorization purposes. I'd like to set the current title of iTerm to match the name of ...
1 vote
1 answer
142 views

Change the color of the omitted newline char in fish shell

Is there any way to change the color of the "⏎" sign after output of echo -n a (or any command which doesn't have \n at the end of the result)? It's unreadable if using black background. There is an ...
1 vote
1 answer
268 views

Error on iTerm2 fish shell load: `function: Illegal function name '-v'`

On iTerm2 load: Last login: ... on ... function: Illegal function name '-v' ~/.iterm2_shell_integration.fish (line 86): function -v _ underscore_change if [ x$_ = xfish ] ...
1 vote
1 answer
408 views

What, if any, is the equivalent of bash's select...in...do..done in fish?

I had finessed in bash a function that changes to any directory below the current working directory by having that directory name as a parameter to the function. If there are multiple results by that ...
3 votes
1 answer
2k views

How to chain a group of commands in Fish like { … } Bash?

I'm aware of chain Fish commands via && or || but I'm willing to chain a set of commands Code env git clone --depth=1 https://github.com/rafaelrinaldi/theme-pure.git; or { printf "Error: ...
1 vote
0 answers
251 views

Why does fish shell create a hidden process in iTerm2

I've moved from bash to fish shell in iTerm2. However, whenever I start iTerm2, I receive the following error message: A session ended very soon after starting. Check that the command in profile ...
2 votes
1 answer
628 views

Using Fish + NVM + Sublime results in commands not found

I'm using Fish shell/omf, NVM (https://github.com/derekstavis/plugin-nvm), and Sublime Text 3. I'm trying to use a build system to run nodemon (which I installed with npm -g install nodemon). nodemon ...
1 vote
1 answer
4k views

Change color of hostname in Fish shell prompt

I'm migrating to a new Mac, and I'm having trouble setting up my shell to match the old one. Old: New: Notice the host color is different? I copied the entire .config/fish folder over to the ...
0 votes
1 answer
2k views

fish shell how do you check for root

Is there a way to assert the current "user" is root (i.e. the script was run by root) using the fish shell? I know for bash you can check the EUID
2 votes
2 answers
142 views

Combining functions in Fish

In Fish shell I have two functions: function be bundle exec $argv end function rdbm rake db:migrate end I typically use them together, i.e. bundle exec rake db:migrate but not always, so I'd ...
2 votes
1 answer
260 views

How to get fish-style formatting with less

Let's say I run a command like ls in fish and get lots of output, how do I scroll through it and still keep the fish formatting or something like it? ls | less doesn't keep the formatting. I know ...
2 votes
1 answer
1k views

How to show fish shell completions in a menu and window pressing tab

Currently fish shell (2.3.1) shows the completion list after pressing Tab. You can navigate through the list using the arrow keys or Tab. If possible, how can I show the completion list in a pop menu ...
0 votes
1 answer
259 views

Bad fish configuration preventing usable login to remote server

I messed up configuring my config.fish, and I now cannot use my server. Whenever I try to log in, it says fish: Unknown command '/usr/bin/keychain /home/freebsd/.ssh/id_dsa' /home/freebsd/.config/...
2 votes
1 answer
684 views

PYTHONPATH Getting set in Bash Shell to incorrect value

OS: macOS Sierra Beta 6 Python: 2.7 Shell: Fish I am having issues with my PYTHONPATH environmental variable being set correctly. In my fish_config file, I have this line setting up PYTHONPATH: set ...
5 votes
2 answers
4k views

How can I do string manipulation in fish shell

How can I do bash style string manipulations in Fish shell? Specifically, in bash read branch < ".git/HEAD" branch=${branch#ref: refs/heads/} will put the branch name in $branch variable. How ...
5 votes
5 answers
4k views

fish control-left control-right keybindings

I'm using terminator along with fish and I want to use Alt-Left etc for navigating terminator and Ctrl-Left and Ctrl-right to move the cursor by word. The problem is when I do bind \cleft backward-...
0 votes
2 answers
84 views

Very weird directory when editing a function in Fish

I am just curious what the meaning is of this bizarre directory from which atom is launched to edit a function from the Fish shell. Anyone have any idea?
4 votes
1 answer
3k views

How to expand aliases in fish shell?

In bash you can expand an alias you type. For example if I have an alias cmd="cd ~/user", typing in cmd and then hitting Ctrl+Alt+e would change it to cd ~/user. Is there a way to do this with fish?
1 vote
2 answers
999 views

Ctrl-enter for fish shell

I had tried to create some accept completion and execute right away combination in fish on pressing Ctrl+Enter. function fish_user_key_bindings bind \c\n accept-autosuggestion execute end ...
1 vote
1 answer
544 views

Different options for installing Fish shell on OS X

I want to install Fish on my Mac, and there are three different installation options on the Fish website: there is an installer, installation via Homebrew, and an app. Which one of these should I ...
0 votes
2 answers
146 views

Unescaped commandline content in fish shell

Is there a way to get the unescaped content of command line in fish? I mean if command line is like ... $ ls 'foo' "bar" ... the desired output would be ls 'foo' "bar". The commandline fish command ...
24 votes
2 answers
17k views

Why am I having / how can I fix this error: "shell_session_update: command not found"

Background I am getting into Ruby 2.x, and Rails 4.x, on a MacBook using OS X El Capitan (10.11.3), using the fish shell, employing the integration listed on this page: RVM - Fish Shell (Integration) ...
1 vote
1 answer
826 views

Pipe in Environment variable in fish shell doesn't execute the first command?

I want to set fish_greeting to date --rfc-2822 | cowsay -f tux | lolcat (don't judge me). When I run date --rfc-2822 | cowsay -f tux | lolcat interactively, I get the proper output (the date in a ...
15 votes
2 answers
2k views

Bind shift-tab to complete-backward in fish

I found myself using the auto-complete functionality of the fish-shell, where pressing tab twice or more cycles through the suggestions. But then I accidentaly pressed tab once to many, and I wanted ...
19 votes
4 answers
8k views

sudo keeps asking me for my password in fish shell

sudo in Ubuntu keeps asking me for my password for every command. Previously, I only had to enter the password once, and then it would be remembered for a period of time. This recently changed, ...
1 vote
0 answers
150 views

For what purpose is the '&-' file descriptor used in fish?

From the fish manual: [The File Descripter may be] an ampersand followed by a minus sign (&-). The file descriptor will be closed From the Arch wiki:. Silencing standard output: $ ...
0 votes
1 answer
371 views

Trouble installing fish shell on OS X non-admin user group

I am struggling to install the fish shell on OS X El Capitan. My user structure is setup so I have an administrator account and a standard account. The standard account is the one that I use and ...
2 votes
1 answer
735 views

Is administrator account necessary in order to use shells such as zsh and fish?

I have a weird situation. I’m using Mac OS X 10.11 (El Capitan) and iTerm2. Zsh is listed by default in /etc/shells as /bin/zsh, and this allows me to use Zsh without any issues on my standard ...
1 vote
0 answers
1k views

Creating an alias for in fish shell: The file 'vim' is not executable by this user

I'm trying to create an alias for vim to execute vimx. After creating a new terminal when I try to auto complete vi, I get the following error: fish: The file 'vim' is not executable by this user /...