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
35 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 ...
user avatar
  • 103
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?
user avatar
-1 votes
4 answers
35 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 ...
user avatar
-1 votes
0 answers
41 views

apt-get error with fish shell: gpgv not installed

I've recently been trying out fish shell and tried to run sudo apt-get update and received the following error: Err:1 http://us.archive.ubuntu.com/ubuntu impish InRelease gpgv, gpgv2 or gpgv1 ...
user avatar
0 votes
0 answers
24 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) ...
user avatar
1 vote
1 answer
40 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 ...
user avatar
  • 133
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 ...
user avatar
  • 31
0 votes
2 answers
58 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
user avatar
  • 1,689
2 votes
1 answer
65 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. ...
user avatar
3 votes
1 answer
157 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: /...
user avatar
0 votes
3 answers
74 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 ...
user avatar
2 votes
2 answers
107 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 ...
user avatar
0 votes
0 answers
103 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, ...
user avatar
1 vote
0 answers
155 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 ...
user avatar
1 vote
1 answer
485 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, ...
user avatar
-1 votes
2 answers
90 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 ...
user avatar
1 vote
1 answer
131 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 ...
user avatar
1 vote
1 answer
131 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 ...
user avatar
  • 111
0 votes
1 answer
28 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 ...
user avatar
0 votes
1 answer
48 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 ...
user avatar
0 votes
0 answers
67 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 ...
user avatar
2 votes
4 answers
327 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 ...
user avatar
0 votes
1 answer
150 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 ...
user avatar
  • 1
2 votes
1 answer
136 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 ...
user avatar
0 votes
1 answer
92 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. ...
user avatar
  • 163
2 votes
2 answers
288 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 ...
user avatar
1 vote
2 answers
111 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 ...
user avatar
1 vote
2 answers
196 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 ...
user avatar
2 votes
1 answer
62 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" ...
user avatar
  • 123
1 vote
1 answer
56 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 ...
user avatar
  • 13
-1 votes
1 answer
109 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 ...
user avatar
  • 113
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 ...
user avatar
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 ...
user avatar
  • 121
2 votes
2 answers
119 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 &...
user avatar
  • 2,034
0 votes
2 answers
563 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 ...
user avatar
-2 votes
1 answer
99 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, ...
user avatar
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 ...
user avatar
  • 176
0 votes
0 answers
125 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}" \...
user avatar
0 votes
1 answer
459 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). ...
user avatar
  • 111
1 vote
1 answer
266 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 ...
user avatar
1 vote
1 answer
125 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-...
user avatar
0 votes
2 answers
291 views

How to change shell without the command line

Something broke my fish and I have no idea how to fix it so is there a way to change shell to zsh without using the command line
user avatar
2 votes
0 answers
108 views

Memory usage out-of-control with shell command, but not with shell script

[Linux Mint 20.1, 16GB RAM, 16GB swap] I recently converted my system - root and backup partitions - to BTRFS. I've been experimenting with archiving some of root's snapshots to my backup drive, but ...
user avatar
  • 2,554
1 vote
0 answers
66 views

urxvt writing over itself and leaving colored spaces

URXVT is writing over itself and leaving behind colored spaces... I feel like this is easier shown than described: This started occurring overnight without making any changes, so I'm not sure where ...
user avatar
  • 11
3 votes
1 answer
140 views

How to write a command to history in fish shell?

In the zsh shell, I can write something into the command line history like so: #!/bin/zsh cmd="cd /special/dir" print -s $cmd" # save command in history for reuse How may I do ...
user avatar
  • 43
2 votes
0 answers
190 views

Ranger image preview not working in URXVT running Fish shell until I open an image in Feh

I recently started using the Fish shell, and after opening a new URXVT instance I cannot get image previews in Ranger until I open an image first (using feh, in my case). Once an image has been opened ...
user avatar
0 votes
1 answer
1k views

Error in terminal emulator: Alacritty

I installed Garuda Linux today. The default shell emulator is Alacritty and the default shell, fish. However, after the update to the system, its constantly giving a warning: Config error: shell: data ...
user avatar
2 votes
1 answer
118 views

Is it possible to disable the & ampersand character in fish shell? (make escaping with \& unnecessary)

So it is possible to permanently disable the functionality of ?, making \? unnecessary, by enabling the qmark-noglob feature flag. I would like to do the same thing for &, as I never use it for ...
user avatar
-1 votes
1 answer
158 views

How to set environmental variables in Fish?

Guys I recently switched to fish from Bash and I've run into problems setting some specific variables for golang in fish. In my bashrc I would set them using: export PATH="$PATH:$(go env GOPATH)/...
user avatar
1 vote
1 answer
3k views

Fish: The file is not executable by this user

I made fish function in ~/.config/fish/functions/confgit.fish: function confgit /home/john/Projects/confgit $argv end But when I run this function it just says: fish: The file “/home/john/...
user avatar