As of May 31, 2023, we have updated our Code of Conduct.

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
5 votes
2 answers
375 views

How to split a string (of arguments) in fish?

I want to split "-r --run" into "-r" and "--run" for string split " " "-r --run" I get string split: -r --run: unknown option as an error. It is ...
RHOOPH's user avatar
  • 85
0 votes
2 answers
109 views

How to save abbreviation in fish?

Running abbr --add ro rpm-ostree will set the abbreviation and it works as expected. But once I exit the shell with exit and then re-enter the shell by typing fish again, all abbreviations are lost. ...
RHOOPH's user avatar
  • 85
0 votes
1 answer
60 views

Can't change terminal colors for prompts in Ubuntu on Windows Terminal

I run Ubuntu with fish using wsl on Windows Terminal. I have color scheme configured correctly and it seems that all the colors are changed except for the prompt colors. It remains red on typing and ...
Peter S.'s user avatar
  • 101
0 votes
0 answers
93 views

Fish bobthefish powerline some symbols not working on Ubuntu WSL

I have the following fish shell on Windows Terminal As it can be seen most of the symbols are working for powerline but some are not working. I have already downloaded and set the font in the Windows ...
dracarys's user avatar
  • 113
0 votes
1 answer
121 views

Fish shell: Map jk to enter normal mode (in vi mode)

While using vi keybindings in fish shell, is it possible to map jk to enter Normal mode? Currently Escape is used for doing that but I want to change (or add a new way) to do so.
GoodBoyNeon's user avatar
0 votes
1 answer
93 views

Hardcoding current path to alias

I am developing a simple cli-application for timetracking. The idea is to have fish-aliases source r-scripts to create timestamps in a timetable. Like so: alias checkin='rscript (echo $PWD/checkin.R)' ...
s_dav's user avatar
  • 25
0 votes
1 answer
52 views

How to disable SVN function in Fish shell?

How to disable a specific feature in the fish shell? For example, I want to disable the Subversion integration. When I enter in a directory (cd) of whatever medium-to-big repository with Subversion, ...
Valerio Bozz's user avatar
0 votes
0 answers
14 views

How to migrate universal variables between computers in fish shell [duplicate]

I recently changed laptops. I have all the original files for fish configuration, including the ~/.config/fish/fish_variables. But I cannot source that file and it says I cannot change it. So, how do ...
Roberto Morávia's user avatar
1 vote
1 answer
154 views

Preserve command history in chronological order (in fish)

I have noticed that default behaviour for storing command history is only storing the latest entry. Typing ls and then ls -al and then entering history would show: ls -al ls Typing ls once more would ...
s_dav's user avatar
  • 25
0 votes
0 answers
51 views

Changing login shell when xmonad is installed from cabal results in being locked out of xmonad session

I installed xmonad via cabal-install as shown here: https://xmonad.org/INSTALL.html It ran fine, and accepted pretty advanced configurations without a problem. However, changing login shells into zsh ...
Crimson Crusader's user avatar
1 vote
1 answer
173 views

PYTHONPATH defined on multiple vs single line in fish shell

I noticed that set -xg PYTHONPATH "/path/to/dir1" set -xg PYTHONPATH $PYTHONPATH "/path/to/dir2" works, whereas set -xg PYTHONPATH "/path/to/dir1 /path/to/dir2" does ...
Labrador's user avatar
  • 143
0 votes
2 answers
341 views

How does one inspect command history in fish in vi mode?

I'm a new user to Fish. I use vi command line bindings. I understand from various places (like here and the issue comments here, for instance) that history search and recall can lack certain bindings ...
firebush's user avatar
  • 409
0 votes
2 answers
5k views

how to run ssh-agent in fish shell?

I was running eval `ssh-agent -s\` I get this error fish: Unknown command: `ssh-agent
Shriman Keshri's user avatar
-1 votes
1 answer
416 views

How do I launch the fish shell in WSL through Cmder?

Setting it as the default shell in Ubuntu WSL results in the PATH not working properly, as described in the docs. So I want to avoid that issue by launching it through the terminal.
alicode1111's user avatar
1 vote
1 answer
770 views

FISH - How to hide hostname/computer from prompt?

For context, I am using FISH 3.1.0. I looked in fish_config, but none of the prompt options just remove the hostname/computer while keeping the rest the same. Is there a way to keep most of the ...
Tyler Shellberg's user avatar
2 votes
1 answer
469 views

How to open new terminal window in previous directory using fish shell?

I use fish shell and Gnome-Terminal Version 3.44. When I open a new terminal I'd like it to start up in the previously-visited directory. How can I implement this via fish shell?
quiltedcomputer's user avatar
3 votes
1 answer
609 views

I deleted fish shell and now VS Code terminal doesn't work

I have been working on a tutorial in Angular. Everything was working fine before I went to work today. I came back to my home computer after work today and the fish shell I was using within VS code ...
Michael's user avatar
  • 51
1 vote
1 answer
639 views

tmux changes shell prompt

Ubuntu 20.04 (running inside VirtualBox, if that's important.) tmux 3.0a (installed via apt) fish 3.4 (and earlier 3.3) starship.rs 1.1.1 Font: FiraCode Mono I have configured my prompt to look as ...
navneethc's user avatar
  • 113
0 votes
1 answer
451 views

iTerm2 clear screen should not delete output of running command

When I used command + k the output of the actual running command was not cleared. Now with my new MacBook I don't know how to set this feature again. Has anyone an idea?
Ben Keil's user avatar
  • 101
2 votes
1 answer
513 views

Is it possible to set separate fish color configurations for light and dark system theme?

I use a terminal (Iterm2 Beta) that allows you to set a separate theme for light and dark mode. This is useful for changing the background color of the terminal, and the contrast of the various preset ...
Cypress's user avatar
  • 121
2 votes
2 answers
1k views

Accidentally deleted fish while it was being set as my shell - what can I do?

I'm on macOS and I accidentally removed /usr/local/bin/fish while fish was being set as my shell. Now when I try to start my terminal I get: login: /usr/local/bin/fish: No such file or directory What ...
Hommer Smith's user avatar
3 votes
3 answers
431 views

How do I add a keymap into fish vi keybindings?

I've just started using fish and I'm loving using the vi keybindings it provides. I wanted though to add a custom keymap that I use in vi. I usually map space+c in visual mode to yank to "* (...
Augusto's user avatar
  • 133
1 vote
1 answer
445 views

How to remove leading file path information from fish shell tab-complete suggestions?

Using fish, typing ls <tab> in an example directory, the terminal displays: $ ls bar/ dir/ foo/ Continuing with d<tab><tab> this becomes: $ ls dir/ dir/moredir/ dir/otherdir/ ...
Quappas's user avatar
  • 15
0 votes
0 answers
197 views

Retrieve current folder on custom command on gnome-terminal

I'm using fish for some days upon Ubuntu gnome but I don't know if that's possible to keep the feature "open the terminal in a specific folder". Inside Files app, I right click inside a ...
Ser's user avatar
  • 101
0 votes
1 answer
572 views

Tools and utilities don't work when fish is made default shell

WSL2 running Ubuntu 20.04 | fish 3.3.1 (installed via PPA) When I try to invoke tools like poetry and rustup (which were installed when I was using bash) in a temporary fish session (by running fish ...
wheres_the_github_login's user avatar
1 vote
1 answer
644 views

How to use jenv with Fish shell on Linux?

I downloaded jenv using the official instructions, added it to the PATH and then tried to init it, using the command given in the instructions, but it throws the following error: > source (jenv ...
MauriceNino's user avatar
1 vote
0 answers
67 views

Is there a way to search token history rather than entire commands

The default fish or fzf implementations for ctrl-R is very helpful for looking through and replacing the prompt buffer with lines in history. Is there something similar to alt-up/down, history-token-...
Xster's user avatar
  • 2,825
0 votes
2 answers
1k views

Fish shell: Set variable outside of current shell

I would like to create the variable $EIGENto save the path where I installed the Eigen library in order to link in with my compiler. For this I was using set EIGEN path/to/eigen However if I echo $...
TheFibonacciEffect's user avatar
1 vote
1 answer
458 views

Function does not autoload in Fish shell

I have a fish function in a file called mvnw.fish in /Users/myUser/.config/fish/functions The /Users/myUser/.config/fish/functions directory does appear (in first position, not that it matters) in $...
ptpdlc's user avatar
  • 175
2 votes
1 answer
4k views

Alacritty cursor always block (█)

I reinstalled Ubuntu (LTS) yesterday and now my cursor in Alacritty is always a block (█). It works fine in Neovim but whatever I do it stays the same in my normal shell. I tried it in fish, bash, sh, ...
Nils's user avatar
  • 51
1 vote
1 answer
134 views

What is the cause of this seemingly random error that occurs when I start the fish shell?

I'm sorry that I'm asking a question like this here, but I have absolutely no idea what is causing it, and I can't seem to find any information anywhere else. Whenever I launch fish on my computer (...
Shock9616's user avatar
0 votes
0 answers
82 views

Fish shell alternates between prepending ~ and > depending on which directory I am in

I'm new to using the Fish shell; however, I'm observing some strange behaviour when I navigate between directories. Below is the output of my shell. Initially, all commands are prepended with ~; ...
ptk's user avatar
  • 127
0 votes
1 answer
157 views

Is it possible to have an abbreviation in a shell anywhere in a command?

I have a directory which has a really long path. However, I use this directory constantly and I cannot move it (WSL Windows directory). I generally use z to jump around to it quickly which is useful, ...
ZackT's user avatar
  • 53
1 vote
1 answer
44 views

distinguish C-i from Tab in Fish?

My fish configuration contains following bindings: bind \ci nextd-or-forward-word bind \co prevd-or-backward-word bind \t complete When I comment out complete then directory navigation to works as ...
bataliero1234's user avatar
1 vote
1 answer
265 views

fish shell outputs ⏎ (i.e. an "abandon line") during startup on smaller terminal sizes

Whenever I open a new terminal window (that's <100 columns wide) Fish prompts me with: ⏎ foo@bar ~> I'm not expecting that first line with ⏎ to appear! If it's 100 columns or wider, then this ...
Sam Mason's user avatar
  • 267
0 votes
1 answer
518 views

How do i pass function parameter as string in fish shell

Octave has an --eval option that takes a sting like "sqrt(4)" and outputs "ans = 2". I want to create a function that passes the a parameter as string so i can call it like this: ...
Paul Schuldesz's user avatar
1 vote
2 answers
197 views

Why fish shell does not allow function named `-`

I am trying to use fish as my default interactive shell. I was previously using bash and there was support for alias named - (ASCII hyphen, 0x2d). Why does not fish allow creation of alias or function ...
jiwopene's user avatar
  • 341
2 votes
1 answer
487 views

How to I persist prepended items to PATH in fish shell?

My PATH Prefixes Don't Persist I'm using Fish v3.2.0. According to the documentation, set -U fish_user_paths should persistently ensure that the directories stored in it should be looked up before ...
CodeGnome's user avatar
  • 2,061
1 vote
1 answer
625 views

Run the current command and pipe the output to fzf

What would be an easy way to bind a key binding from fish to run the current command prompt and pipe it to fzf for easy search/selection? i.e. a 1 key-press way of accomplishing | fzf (enter)?
Xster's user avatar
  • 2,825
5 votes
2 answers
627 views

How can I ask `fish` to enumerate all the locations it's reading configuration from?

When I start fish, I'd like it to print every location it's reading configuration, profiles, and customizations from, so that I can: understand which specific paths I need to backup if I want to ...
John Feminella's user avatar
3 votes
1 answer
265 views

Is there a fish way of doing zsh's noglob builtin?

From https://linux.die.net/man/1/zshmisc : noglob Filename generation (globbing) is not performed on any of the words. zsh example: $ ls /* <lots of output> $ noglob ls /* ls: cannot access '/...
snapshoe's user avatar
  • 1,156
6 votes
2 answers
1k views

Where is the best place to add an “ssh-add” command in fish shell startup?

At some point I added an ssh-add invocation to my config.fish file. So every time I open a terminal, that runs for a couple of seconds. Is there a better place to set this, so that it runs upon login? ...
tom's user avatar
  • 201
0 votes
0 answers
2k views

MobaXTerm “Follow Terminal Folder” STFP & Fish Shell

MobaXterm's "Follow Terminal Folder"/"Follow SSH Path" feature works great when remote SSH into a linux computer, it shows directory & files to the left as you work in the ...
apfsx's user avatar
  • 1
1 vote
1 answer
745 views

Minimal Backup of Fish Shell Config

Thanks to the influence of many, including one who has a passing association to a certain green tinged distro I have moved over to fish (from zsh). However config is quite different and I couldn't ...
user avatar
2 votes
2 answers
1k views

Execute two or more commands simultaneously in shell script

It is often very helpful to run commands in parallel in a shell script, but I cannot find ways to do it. Is this possible? If so, how would I achieve that? I'm mainly interested in doing that for fish....
Joy Jin's user avatar
  • 165
1 vote
1 answer
429 views

Change the startup directory to something other than HOME

By default, when I open the fish shell, my working directory is the home directory. Is there a way to change the default working directory on startup, without having to edit the HOME variable?
jallersma's user avatar
1 vote
1 answer
501 views

How can I change the prompt to always show the current path?

I want to continue using the fish shell with as little changes to default setup as possible. But there is one thing that really bugs me. When the terminal window is cramped the prompt just becomes >...
user1283776's user avatar
1 vote
1 answer
1k views

tmux run a pipe/chain of commands with keybinding

How can I run a chain of command like in shells with tmux? I want to run multiple commands based on success of them. I want to echo out to terminal (or command bar) E.g. I have a keybinding to reload ...
user14492's user avatar
  • 140
4 votes
1 answer
2k views

/bin/bash shell (macOS) throwing `-bash: declare: -A: invalid option` error message at shell start

I briefly changed my default shell on macOS Catalina (10.15.1) to Fish, following the steps in Fish's documentation. First, I executed > echo /usr/local/bin/fish | sudo tee -a /etc/shells followed ...
thrillifying's user avatar
2 votes
1 answer
735 views

Is there a Fish equivalent to "bash --rcfile ~/.bashrc"

I've just moved over to fish shell after years of Bash. I've ported all of my functions over pretty easily except for a very simple one I have called mkroot: mkroot () { sudo bash --rcfile ~/...
Adam Shand's user avatar