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
2 votes
1 answer
33 views

Fish needs a lazy evulation to remove an element from a list

I'm running Fish version 3.7.0, and I want to write a function to remove elements from lists, based on their index. For instance, I want to remove the element from PATH environment variable at index 2:...
uilianries's user avatar
1 vote
1 answer
48 views

Fish access non-aliased command from alias

How can I access the non-aliased version of a command from within the alias for that command? In bash, I can do something like alias ls='\ls -l' to access the non-aliased ls inside this alias for ls. ...
The Bic Pen's user avatar
0 votes
1 answer
84 views

How to run a fish alias from cron?

I have set up a fish alias for some commands that I frequently need to run manually. Now, I want the same commands to be run regularly. How can I set up cron to automatically run a fish alias?
Thomas's user avatar
  • 166
0 votes
2 answers
325 views

Batch convert flac to ogg with ffmpeg

I'm trying to turn this command into one that will convert a whole directory from flac to ogg: ffmpeg -i musicfile.flac musicfile.ogg I've read through the man page. But honestly it's a bit over my ...
h8uthemost's user avatar
0 votes
1 answer
125 views

FISH CLI What do the error numbers at the prompt mean?

I am just trying out the FISH - (the FriendlyInteractiveSHell) - CLI & whenever I type in an erroneous Command, a new Prompt appears under the faulty Command prompt with a number in square ...
beagleburt's user avatar
1 vote
3 answers
90 views

In Fish, how do I cd to the closest parent with a .git directory?

I use Fish shell. Sometimes, I find myself in a child directory of a child directory of a child directory, several layers deep, and I want to return to the closest parent with a .git directory, as ...
Flimm's user avatar
  • 4,228
0 votes
2 answers
407 views

I have to run eval $(/opt/homebrew/bin/brew shellenv) every time I start my pc for the terminal to recognise it

I use the Fish shell on OSX and installed brew. Now I notice everytime I start my mac I need to run the eval $(/opt/homebrew/bin/brew shellenv) command again to make it recognice brew. I also noticed ...
Wout Junius's user avatar
0 votes
1 answer
299 views

fish 'Invalid redirection target' error

This command works well in Bash and Zsh: expac -H M "%011m\t%-20n\t%10d" $(comm -23 <(pacman -Qqen | sort) <({ pacman -Qqg xorg; expac -l '\n' '%E' base; } | sort -u)) | sort -n But ...
MHM's user avatar
  • 21
1 vote
1 answer
60 views

Completion for gradle not applying

I'm trying to understand why the gradle completion isn't applying. Since gw seems to be a keyword for the completion, I created an alias: alias gw='./gradlew' (My project uses gradle wrapper. I don'...
Tyler B's user avatar
  • 113
1 vote
2 answers
298 views

git autocompletions in Fish: how can I disable them or speed them up?

I'm running Fish shell (3.6.0) on Ubuntu. Let's say that I'm trying to run git add foo/bar.txt . I type: git add foo and then I press tab . Now the shell freezes up for a few seconds. Even pressing ...
Flimm's user avatar
  • 4,228
1 vote
1 answer
175 views

where a variable inherit from, Fishshell

i'm trying to set an environment variable EDITOR and change it from default which is /usr/bin/nano but i can't use set -Ux due to this behavior fish FAQ How to find out which setting fish inherits ...
Naadiyaar's user avatar
0 votes
0 answers
44 views

Fish shell can't change directory over a Webdav resource through Rclone

Fish can't cd into a folder on a Webdav remote directory through Rclone: Welcome to fish, the friendly interactive shell Type `help` for instructions on how to use fish drive ) ls Documents/ Music/ ...
freezr's user avatar
  • 11
-1 votes
1 answer
2k views

WARNING: Running setxkbmap against an XWayland server

I'm using Fedora 37, tilix terminal emulator with fish shell. Whenever I open a terminal, I get the warning WARNING: Running setxkbmap against an XWayland server How come? How to avoid it?
tsorn's user avatar
  • 119
3 votes
2 answers
802 views

FISH: failed to execute process...variable exceeds the OS argument length limit

I keep getting an error when I cd to my project root directory that is on github: > cd ~/go/src/github.com/mygithub/myapp The below message auto pops up because I am using tide prompt which links ...
chuckd833's user avatar
-1 votes
1 answer
392 views

Troubleshooting Oh-My-Fish configuration making fish really slow

Without changing the configuration my fish shell started to be really slow, like between 1 and 5 seconds to a simple ls command. Note that the slow behaviour started suddenly. I have a local install ...
EPrivat's user avatar
0 votes
0 answers
820 views

direnv and environment variables

I'm trying to get autoactivation of conda/mamba environments working using direnv but I'm running across a problem that seems to be due to my lack of understanding of how bash scripts work with ...
zoof's user avatar
  • 1
0 votes
1 answer
78 views

Error in fish script turns on bracketed paste mode for ssh session?

When using a small fish function I’ve cobbled together (not a developer here, so please be gentle … 😌) for accessing a number of regularly needed ssh hosts, I’m seeing a strange effect: The bracket ...
bogenschlag's user avatar
4 votes
1 answer
217 views

Fish equivalent of Bash / readline's Ctrl-O "operate-and-get-next"

Readline and therefore Bash have a very useful command called operate-and-get-next, bound by default to Ctrl-O, that executes the current line, after selecting it from the history, and advances the ...
Tobia's user avatar
  • 679
0 votes
1 answer
112 views

Copy files with different extensions to different basename with same extensions

I have 3 files Original.js Original.vue Original.css How can I easily copy them to Copy.js Copy.vue Copy.css Until now, i always just copied one by one, but if I could use something like copy ...
Jérôme Tremblay's user avatar
0 votes
0 answers
482 views

Trying to change "non command" color in kitty terminal (ver. 0.21.2) using the fish (ver. 3.3.1) shell with the oh-my-fish theme slacker

I've been trying to change the color of non-command such as the picture below (the uncompleated 'help') link to the theme im using in omf: https://github.com/maqboolkhan/omf-theme-slacker my kitty....
Manfred's user avatar
  • 25
1 vote
1 answer
115 views

Unable to run git commands before shutdown

I would like to use systemd to accomplish this if possible. This is what I have done so far. Wrote a script in fish that will stage, commit and push files to a repository. Script made executable with ...
YJH16120's user avatar
  • 113
0 votes
1 answer
142 views

Where is the default fish completion style defined or how do I style the fish completion options listing?

I'm using complete -c cl -o editz -f -xa '(cl -autocomplete 15 | sed "s/:/\\t/" | sed -r "s/^(.{60}).*/\1/")' to dynamically feed the latest 15 entires in a log program to fish for ...
henderjon's user avatar
1 vote
2 answers
2k views

How to run a command n times in the fish shell?

The fish documentation gives the following way to run a for loop. for i in 1 2 3 4 5; echo $i end Let us say I want to run a command 1000 times, How can I do it?
berinaniesh's user avatar
0 votes
1 answer
174 views

My fish prompt gets messed up when I add more set_color

I've been trying to make a custom fish prompt, but there's one problem that I can't seem to figure out how to fix. I got this to work, but it's not exactly what I want, as I want the ash@cat-box to be ...
Ash's user avatar
  • 1
0 votes
1 answer
93 views

'fish_config browse' opens balena etcher instead of the default web browser

When I type fish_config browse in fish to configure it, it opens Balena etcher and not the web browser. I am on Pop!_OS 22.04 lts and migrated from bash.
Elouan660's user avatar
0 votes
1 answer
71 views

Complete a positional argument only once

I'm trying to write a completion for a command (call it gs) that takes an SSH hostname as its first argument, and an arbitrary string as the second argument. I've stolen this from the default SSH ...
Arno's user avatar
  • 103
1 vote
1 answer
127 views

Fish completion that depends on other flags

I have a command, that can connect to remote machines and so the completion should be based on which machine the user provided. That means that if the user pass -D DEVICE_ID I want the completion to ...
yotamN's user avatar
  • 111
0 votes
1 answer
925 views

Fish shell - what's wrong with this syntax?

I have a bash script which cats a heredoc string, and I'm running it inside a fish shell and then piping it to a source call, like so: ~/foo/baz: 1 #!/usr/bin/env bash 2 3 cat << EOS 4 ...
Richie Thomas's user avatar
1 vote
1 answer
540 views

Fish shell - syntax for creating a switch statement which checks against an array of values

I'm studying the RBENV codebase, and I see that on line 116 of the rbenv-init file, a function is created which contains a switch statement. My hypothesis is that we check whether the value of the ...
Richie Thomas's user avatar
2 votes
0 answers
284 views

Command line history in the fish shell suffering from short term memory issues

Over the last few months, I've been trying out the fish shell as my interactive shell. One issue that somewhat irritates me is that the shell occasionally forgets recent commands from its command ...
Kusalananda's user avatar
  • 335k
0 votes
2 answers
7k views

Fish shell: How to disable help message?

When I start fish, it prints: Welcome to fish, the friendly interactive shell Type `help` for instructions on how to use fish And then the prompt. I've actually used fish for a while so I don't need ...
Dommondke's user avatar
  • 133
1 vote
2 answers
153 views

Exit 'history' in fish

I recently switched from bash to fish. I like it, but I don't know how to exit, when I enter history. How do I do that?
s_dav's user avatar
  • 13
-1 votes
2 answers
255 views

Use Git Version of mv/rm etc When in Repository

Git has its own versions of commands such as mv and rm that we really ought to use when doing these operations inside repositories. However, I'm sure I'm not the only person who often forgets to do ...
ScottishTapWater's user avatar
3 votes
1 answer
273 views

Fish Completions - How to prevent file completions?

I am trying to write some completions for an in-house tool. We'll call it thetool. Lots of the commands to thetool do not take a 'file' as an argument. I thought that --no-files and/or --exclusive ...
Joel Dunham's user avatar
3 votes
1 answer
882 views

When pressing tab, how can I make fish complete to directory/ instead of directory/prefix?

I'm using fish shell. Let's say that I have a directory named books, containing files title-1, title-2 and title-3: $ tree books books/ β”œβ”€β”€ title-1 β”œβ”€β”€ title-2 └── title-3 0 directories, 3 files If ...
Flimm's user avatar
  • 4,228
2 votes
2 answers
193 views

Fish shell reports "math: Error: Missing operator" on tab completion

I noticed the error this morning, but I don't think I have changed anything last night, so I am very confused right now. Perhaps I updated some utilities on my system and it somehow broke the back ...
nalzok's user avatar
  • 369
1 vote
1 answer
257 views

fish shell: universal variables and alias not shared between "contexts"

I use fish shell mainly from Rider IDE and iTerm2. I've noticed that every task that implies saving something for future sessions will not operate transparently between the two aforementioned contexts....
Lord of the Goo's user avatar
0 votes
1 answer
456 views

How to switch language in fish shell?

I tried to switch languages in fish (eg. French as shell supports it) using sudo dpkg-reconfigure locales, but nothing changed. Exporting LANG variable doing set --global --export LANG fr_FR.UTF-8 and ...
amordo's user avatar
  • 103
1 vote
1 answer
701 views

Fish EDITOR environment variable does not seem to work

I recently started using the Fish shell. echo $EDITOR returns vim But yet, when using programs that need to launch an editor and look for it in the EDITOR environment variable they don't seem to find ...
bastian's user avatar
  • 133
1 vote
1 answer
725 views

Get output of a command that uses curses

If I try to get the output (stdout) of a python program into a variable I do this: set zpath (python something.py "$argv") But if the program spawns a curses interface, it won't show. The ...
madprops's user avatar
  • 190
0 votes
2 answers
1k views

fish shell: why does `file `which command`` work in zsh and bash, but not fish?

Before switching to fish shell, I frequently used various commands in zsh with which some_command. An example might be: $ file `which zsh` /opt/local/bin/zsh: Mach-O 64-bit executable arm64 /bin/zsh: ...
ylluminate's user avatar
-1 votes
1 answer
786 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 ...
SL5net's user avatar
  • 103
1 vote
1 answer
410 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?
Mega Bang's user avatar
-1 votes
4 answers
162 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 ...
Mega Bang's user avatar
0 votes
0 answers
1k views

yt-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) ...
SandWood Jones's user avatar
2 votes
1 answer
893 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 ...
sontags's user avatar
  • 153
3 votes
0 answers
113 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 ...
sayam's user avatar
  • 31
0 votes
2 answers
391 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
mrjayviper's user avatar
  • 2,051
2 votes
1 answer
295 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. ...
Laptop-Nuub's user avatar
3 votes
1 answer
1k 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: /...
Bernard Halas's user avatar

1
2 3 4 5