Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

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
1 answer
37 views

New Fish-Shell Aliases are ignored

as explained in https://stackoverflow.com/a/2763014/2891692 i created for days many alias in my config file ~/.config/fish/config.fish and it works. every new alias i add today don't work. Example of ...
4 votes
0 answers
102 views

Tracing environment variable modification in the fish shell

There's one item I used to use in $PATH, which is ~/.workspace/bin. I can't figure out where it's coming from. I changed the user shell to /bin/sh, logged in from TTY, checked $PATH, and it was clear ...
1 vote
1 answer
31 views

fish: bind ctrl+space to undo in terminal command line

abbr -a gc git commit After expanding gc via pressing space, I want to undo via pressing ctrl+space in fish shell. How do i do that?
-1 votes
4 answers
36 views

fish: cd to the most recently modified child directory

related to this post, cd to the most recently modified child directory bash cd "$(\ls -1dt ./*/ | head -n 1)" zsh cd ./*(/om[1]) changes to the most recently modified directory. But there ...
0 votes
0 answers
30 views

ytp-dlp with external downloader has black frames

I have the following fish shell script for downloading a slice of a video using yt-dlp and ffmpeg function yt-dlp-trim -d "Download a slice of a video with yt-dlp" if test (count $argv) ...
2 votes
4 answers
341 views

fish shell alias only in specific directory

I am using fish and am working on a project with a script that's frequently invoked for build tasks called x.py. I'd like to create an alias that maps x to ./x.py. However, I only want this to apply ...
1 vote
1 answer
41 views

Keep cursor/prompt vertically centered in ZSH/FISH

I was wondering if there is an easy way to configure ZSH (I am using oh-my-zsh) and/or FISH (just started fiddling with this) to not keep the cursor/promt at the bottom of the terminal as soon an the ...
3 votes
0 answers
34 views

Sharing fish configuration across computers

I'm trying to share configurations across my computers (macOS and WSL2). Most of my configurations (abbreviations, plugins configuration) are by default in fish_variables which is meant to be ...
17 votes
1 answer
8k views

How to change the default shell in NixOS?

At the moment I need to set the fish shell to be my default shell on NixOS and there is no official documentation on how to do that declaratively (not by running chsh) in NixOS.
2 votes
2 answers
110 views

What's the correct format for MAKEFLAGS when using Fish shell?

To improve compile times, the Arch wiki states, Users with multi-core/multi-processor systems can specify the number of jobs to run simultaneously. This can be accomplished with the use of nproc to ...
0 votes
2 answers
59 views

Fish 3.3.1 shell: how do I negate the results of a string match?

as above. basically I want to implement something like if not match then do these things else do these other things fi Thanks
2 votes
1 answer
66 views

How do I extract variables from a list in fish?

So, I recently downloaded a cli which shares a lot of commands similar to linux. Like mega-login : login & mega-logout :logout and I am too tired of writing mega every time I need to use the cli. ...
3 votes
1 answer
169 views

XDG_DATA_DIRS env variable using two separator types in fish shell

After doing an OS upgrade (opensuse leap 15.2 -> 15.3), my XDG setup broke. Among other things, my XDG_DATA_DIR env var uses two different value separators: : and . Current XDG_DATA_DIRS value: /...
0 votes
3 answers
79 views

Is there a way to validate a completion file?

I have tool that is able to create a completion file for bash, zsh and fish. I normally use zsh, but i cannot get this completion file to work on zsh. So as a test i installed fish and created the ...
1 vote
0 answers
162 views

Fish Shell Showing /usr/bin/git after every command. Any way to remove this?

Been trying to find where this is coming from and I can't seem to figure it out. I know that It's the location of my git install, but not much else. Is it echoing somewhere from some sort of fish ...
0 votes
0 answers
107 views

fzf not using `$FZF_DEFAULT_COMMAND`

I'm trying to get fzf to use rg --files as its command for searching, but can't seem to get it to use the $FZF_DEFAULT_COMMAND environment variable, as described in the docs. I use fish as my shell, ...
1 vote
1 answer
516 views

Using Fish Shell, how can I export a variable from within a file?

We can export variables from the command line with set -x, but I'd like to know how to do this from within a file. The reason is that I'm organizing my $HOME directory according to the XDG convention, ...
-1 votes
2 answers
95 views

What does it mean to both append and prepend a value to a variable (in fish shell or in general)?

Per the fish shell documentation for the set command: append: causes the values to be appended to the current set of values for the variable. This can be used with --prepend to both append and ...
1 vote
1 answer
135 views

Fish environment variables/$PATH in applications started from Desktop Environment?

I'm specifically trying to get NVM to work on Elementary OS with Fish and IntelliJ. There is a fish script that works pretty well as long as I stay in the terminal. However, when I launch my IDE from ...
1 vote
1 answer
136 views

Oh-my-zsh "take" command - Is there an equivalent in Fish?

Oh-my-zsh has the take command which creates a directory and enters into it in one step. Is there an equivalent command for the fish shell? I do know that I can do it with mkdir newDir && cd ...
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 ...
2 votes
1 answer
138 views

Fish shell vi-mode is missing "repeat" command (dot/period/. key in Zsh)

I recently moved from Zsh to Fish, and I'm having a problem with vi-mode in Fish. There doesn't seem to be a "repeat" keybinding, like in Zsh's vi-mode (bound to the "dot" .). I ...
0 votes
1 answer
29 views

Function tab-completion not matching that of wrapped command

I've got a function defined in my fish shell: function cl --wraps=cd cd $argv && ls -l --color=auto end According to man function, the --wraps option "causes the function to inherit ...
0 votes
1 answer
50 views

fish - Maximum recursion depth reached with tab-complete

With my fish shell, I have defined the alias alias black='command black -l 110' When I type black in my shell and start to tab-complete, I get the error complete: maximum recursion depth reached ...
0 votes
0 answers
69 views

Setting Fish Shell as default shell, prevents me from accessing commands

I used the following to set my default shell chsh -s `which fish` Which works great, but many commands such as brew and npm no longer works. Previously, accessing fish shell from zsh shell still ...
0 votes
1 answer
154 views

Fish Shell: Start up script issue

I am not a coder or a programmer, I just try to learn but I have some limitations... I'd like to mount a webdav resource when I logging into the session (virtual console), however I'd like to check if ...
0 votes
1 answer
95 views

MacOS/iTerm2/fish arrow keys stops working after terminating a process with ctrl+c

I am using iTerm2 on my mac pro, and using fish as my shell. Every time I have a process running and I break it by pressing ctrl+c, the arrow keys stops working after and starts emitting ^[[A etc. ...
8 votes
3 answers
8k views

fish shell : exec format error

On an Ubuntu ($ uname -a : Linux kumanaku 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux), I just installed fish ($ fish --version : fish, version 2.7.1) ...
1 vote
2 answers
199 views

How to enable auto logout in fish shell?

A quick google search says I could enable auto logout (for text consoles) by setting a TMOUT parameter. However, I discovered later that this would only work with the bash shell. Is there a way I ...
2 votes
2 answers
296 views

How do I add multiple fish functions in a single script?

I'm trying to shift to fish from zsh. As I've seen, load time of fish increases if I use alias. So I'd like to convert all of my alias into functions, but the thing is creating a function script for ...
1 vote
2 answers
112 views

How to display stdout of command in `less` with as few keystrokes as possible?

I often find myself piping a command's output into less because less is far superior for studying the output than the normal terminal. While I can always append | less to every command, I was ...
2 votes
1 answer
64 views

Fish - remove file before download

I run fish shell and it gives an exception when I try to remove a file which is not found. I have the following script: #!/usr/bin/fish set files "/tmp/*.xlsx" rm -f "$files" ...
2 votes
2 answers
123 views

How to preserve formatting in fish shell command substitution output stored in the var?

I'm already scratching my head for a while because of this: > cat file line1 line2 > set tst (cat file) > echo "$tst" line1 line2 > set tst "(cat file)" > echo &...
1 vote
1 answer
58 views

fish - Run multiple abbreviations with another abbreviation

I have a few abbreviations that I want to run on one command. Let's say given this config: abbr command1 "echo 1" abbr command2 "echo 2" abbr command3 "echo 3" I want ...
245 votes
12 answers
289k views

Execute a command once per line of piped input?

I want to run a java command once for every match of ls | grep pattern -. In this case, I think I could do find pattern -exec java MyProg '{}' \; but I'm curious about the general case - is there an ...
-1 votes
1 answer
112 views

Having an interactive shell experience but running everything through dash

So i'm starting to get addicted to POSIX standards and simplicity yet i hate not having autocomplete using the arrows to go through characters and i want a cool shell prompt. so is there anyway that i ...
0 votes
0 answers
89 views

How to create a keyboard shortcut for opening files after searching through fzf

I can launch a file after searching through fzf by doing xdg-open (fzf) (I'm using fish) or fzf | xargs xdg-open. But these do not work if I try to create a shortcut for opening a terminal and ...
13 votes
2 answers
11k views

Fish-Shell Will Not Save my Aliases

I do not know why, but after making a whole bunch of fish aliases. I'm assuming I have neglected one simple step after assigning them all but I cannot seem find the solution myself. Can anyone lend ...
1 vote
1 answer
113 views

Fish completion script

I'm working on a completion script for a command, and I'm stuck. The docs and various websites I find don't fit what I need. The main command is pacstall and it has the flags: -I -S -R -C -U -V -L -Up ...
0 votes
2 answers
579 views

Environment variables in Fish

I need to use a program called Kpax, the "installation" process consist in this: (for bash users, edit ~/.bashrc) export KPAX_ROOT=/home/dritchie/kpax <- substitute the proper ...
3 votes
3 answers
926 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 ...
55 votes
3 answers
25k 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 ...
1 vote
0 answers
74 views

Make any program "think" its output is a terminal (ie stop it from "knowing" its output is a pipe/file/substitution/etc) to keep ansi-color-codes etc [duplicate]

EDIT: specifically what worked for me was using the python script in this answer and I gave the tweaks I used to get it working for my autoloading functions in fishshell, and on ubuntu 20.04, in this ...
1 vote
2 answers
1k views

Error starting the fish_config web ui in WSL

I want to customize my fish shell using the Web UI mode, but when running fish_config colors, the following error is shown. surface@Surface ~> fish_config starting-colors Web config started at file:...
0 votes
0 answers
130 views

How to make --exclude-glob work with this use case of lftp and fish shell?

I have a statement that looks like this: set cmd 'set ssl:verify-certificate false; open -u abc,def ftp.somewhere.com; mirror --only-newer --exclude-glob "{.git|node_modules|wp-config.php}" \...
-2 votes
1 answer
100 views

Difference between the shells [closed]

I've been using Linux Mint since March 2020, and I haven't used any shells other than the Bash shell. So what exactly is the difference between the Bash shell and the other shells (Fish, Zsh, Ksh, ...
0 votes
1 answer
473 views

xfce terminal ignores set default shell

I changed the default shell with chsh -s `which fish` but my terminal still launches with bash. If I run chsh again, it says chsh: Shell not changed. I'm using Manjaro x86_64 20.2.1 with XFCE (4.16). ...
1 vote
1 answer
271 views

What is the purpose of (and possibly the convention of using) multiple locations for user configuration in fish shell

I have recently moved to fish from bash. I'm immediately in love with the out-of-the-box functionality, but I'm a little bit at a loss when it comes to configuring the shell. I've read through the ...
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 ...
1 vote
1 answer
128 views

How to use hjkl to navigate menu select in fish shell

I can't seem to find any information on how to navigate tab completion or how to bind keys in tab completion in fish shell. This is what I am trying to achieve but in fish shell rather than zsh. Fish-...