Questions tagged [fish]
The friendly interactive shell (fish) is a Unix shell that focuses on interactive use, discoverability, and user friendliness.
187
questions
-1
votes
2
answers
56
views
alias doesn't work in fish shell on macOS
I've been struggling with an issue that I cannot find mentioned anywhere and I cannot trace down. I can't leverage any of the alias command functionality in fish, which also breaks fish integrations ...
0
votes
1
answer
120
views
How to view a folder with the name of "."?
A folder that is named ".", just dot and nothing else, does not appear in dolphin or krusader file managers.
ls -a shows the folder.
Terminal output:
drwxrwxrwx - root 29 Feb 17:05 .
...
2
votes
0
answers
28
views
How do I get iTerm2's prompt to make marks when the prompt is Starship?
I've run into a situation where installing Starship breaks the iTerm2 shell integration feature of making each prompt a "mark".
The only thing Terminal.app has that iTerm doesn't for me is ...
5
votes
3
answers
11k
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
1
vote
3
answers
331
views
Can a fish script distinguish between being sourced and executed?
I have a fish script that exports some variables and launches a command at the end. I'd like to be able to source this file to bring these variables into the current shell session, but without ...
0
votes
1
answer
102
views
Is it possible to manipulate shell input to wrap commands?
I would like to call a function when a command is entered and modify it
for example if a user enters this command
touch foo.txt
I want to manipulate it to run
sudo -u user touch foo.txt
The reason ...
17
votes
5
answers
21k
views
How do you "source" a file in fish?
I'd like to use keychain with the fish shell, but I'm not sure how to get fish to load the ~/.keychain/hostname-fish file to set the appropriate environment variables.
In bash, there's the "source" ...
0
votes
1
answer
456
views
Windows Terminal - Start a new tab using the cli and run a command with fish
I am using the wt.exe CLI to run some WSL commands in a new tab. However, I seem to be getting some weird error when using Fish shell.
The command:
wt.exe --window 0 new-tab -p Ubuntu /usr/bin/fish -C ...
67
votes
3
answers
55k
views
Is there any way to get bash to have syntax highlighting like fish?
In the fish shell, the actual command line is syntax highlighted:
Is there any way to get this same behavior in bash?
There is something just like this but for zsh, not bash. Is it possible that ...
0
votes
1
answer
364
views
How to resolve fish: "Unable to open universal variable file '/': Permission denied"?
Fish gives frequent warnings
error: Unable to open universal variable file '/': Permission denied
What causes this, and how can it be resolved?
47
votes
10
answers
40k
views
re-use '~/.profile` for Fish?
(I'm talking about the shell Fish, esp. Fish's Fish.)
For Bash/ZSH, I had ~/.profile with some exports, aliases and other stuff.
I don't want to have a separate config for environment variables for ...
5
votes
2
answers
805
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 ...
2
votes
3
answers
7k
views
tmux.conf is giving syntax error
My .tmux.conf is
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
set-option -g status-style bg=colour235,fg=colour136,default # bg=base02, fg=yellow
# set window ...
3
votes
1
answer
2k
views
how to move ssh-key related files to another directory?
i've been trying to clean up my root directory so that it isn't clustered with random dotfiles. nonetheless, on setting up the ssh-key i came to a dead-end, where i wouldn't find a way to migrate ...
15
votes
3
answers
20k
views
How do I install/make a custom prompt for fish shell?
I'm using fish 2.0 on Linux, but this might be an installation error, since my ~/.config/fish/config.fish is empty.
2
votes
2
answers
894
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. ...
0
votes
1
answer
581
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 ...
11
votes
7
answers
9k
views
Add abbreviations in fish config
I would like to use the abbreviations feature of the fish shell, especially for the known bash variable !! or aliases to common git commands. I know that abbreviations can be added like in the ...
64
votes
10
answers
25k
views
Is there a “reverse incremental search” functionality in Fish similar to Bash’s CTRL+R?
I’m really impressed with Fish’s autocomplete functionality. However there is one feature in Bash that I’m unable to find in Fish. When you press Ctrl+R in Bash and begin to type out a term, a search ...
4
votes
1
answer
891
views
In fish shell, which command is equivalent to bash's compgen?
compgen is a useful command, and fish is an excellent command shell. But I cannot find an equivalent in fish.
I write one by myself:
function compgen --description 'Print a list of documented fish ...
49
votes
7
answers
19k
views
What is the equivalent of bash's !$ and !! in the fish shell?
I've been using bash for a decade or so and have gotten used to being able to type !$ to repeat the last argument, e.g.:
$ mkdir foo
$ cd !$
cd foo
(That last line is printed by the shell to tell ...
1
vote
1
answer
381
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.
0
votes
1
answer
131
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, ...
0
votes
1
answer
256
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)'
...
42
votes
6
answers
27k
views
How to remove a path from $PATH variable in fish?
I am using fish as my shell in Debian and recently (after some upgrade) whenever I try to use command completion I have:
set: No such file or directory
set: Could not add component /usr/lib/x86_64-...
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 ...
1
vote
1
answer
411
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 ...
1
vote
2
answers
772
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 ...
17
votes
3
answers
16k
views
How to do command substitution in fish shell?
How would a Bash (or other POSIX shell) command like this have to be expressed in fish?
ls -l $(which vim) # or
ls -l `which vim`
2
votes
1
answer
867
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?
16
votes
3
answers
8k
views
Make bash as close to fish as possible
I love the fish shell and use it exclusively in MacOS but I use bash everywhere else because its the only thing installed. Having felt the pain of maintaining configuration files for the two shells, I'...
1
vote
1
answer
265
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 ...
1
vote
1
answer
663
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/ ...
2
votes
2
answers
886
views
In fish shell, how to select with the cursor while shift is held?
In all gui text editing, ctrl-arrow moves the cursor by word, and holding shift selects as the cursor moves. Thus ctrl-shift-left selects the previous word. Fish already has the former but I want to ...
-1
votes
1
answer
560
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.
1
vote
1
answer
2k
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 ...
1
vote
1
answer
768
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?
3
votes
1
answer
968
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 ...
1
vote
1
answer
1k
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 ...
0
votes
1
answer
265
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, ...
0
votes
1
answer
684
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?
2
votes
1
answer
831
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 ...
2
votes
2
answers
624
views
Escape-backspace behavior in fish shell like in other shells
I recently started using the fish shell for some things and generally like it. However I've run across one situation that would be great if there were a workaround. Say I typed a command like this:
...
4
votes
2
answers
1k
views
No colors in weechat, tig, htop, ranger, etc
I noticed that on my Mac I don't have any colors in e.g., tig, weechat, htop or ranger. On my linux I do. It happens in all terminal apps I have (alacritty, iterm and Terminal.app), in zsh, fish and ...
3
votes
3
answers
639
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 "* (...
2
votes
2
answers
2k
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 ...
1
vote
2
answers
327
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 ...
0
votes
0
answers
235
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 ...
0
votes
1
answer
836
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 ...
1
vote
1
answer
1k
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 ...