Skip to main content

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
0 votes
1 answer
59 views

Can't install FISH on Amazon Linux 2023

I have an EC2 instance running Amazon Linux 2023. I added the fish repo per the instructions. I used dnf config-manager --add-repo... and then dnf config-manager --enable-repo.... I also added g++, ...
3 votes
2 answers
293 views

how to alias the `history` function in fish shell

I'm trying to set the fish history pager to be bat -l fish for syntax highlighting. (i.e. set the PAGER environment variable bat -l fish just for the history command). I tried: # 1: alias history &...
1 vote
0 answers
32 views

Fish script works as function, but not as standalone script [duplicate]

I have a small function that activates my desired Python venv - pya venv python_version - so something like this: pya vm_info 3.10.12 As a fish function, this works perfectly: function pya set -l ...
0 votes
1 answer
3k 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?
2 votes
1 answer
49 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:...
1 vote
1 answer
60 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. ...
0 votes
1 answer
130 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?
0 votes
2 answers
532 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 ...
0 votes
1 answer
193 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 ...
2 votes
3 answers
111 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 ...
0 votes
2 answers
659 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 ...
1 vote
2 answers
392 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 ...
0 votes
1 answer
497 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 ...
1 vote
1 answer
63 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'...
277 votes
13 answers
334k 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 ...
12 votes
5 answers
11k views

fish: sudo: !!: command not found

I have fish installed in my Linux Mint DE. I really like how fish makes things easier and it looks so pretty although I haven't find a correct answer about why I can't execute: sudo: !!: command not ...
1 vote
1 answer
233 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 ...
4 votes
3 answers
6k views

How can I start tmux automatically in fish shell while connecting to remote server via ssh

I switched from bash to fish shell. I liked it and decided to use it on my servers also. How can I start tmux automatically on ssh connection? I followed this instruction for bash but fish shell is ...
0 votes
0 answers
47 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/ ...
2 votes
4 answers
1k 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 ...
9 votes
2 answers
2k views

kill %1 equivalent in fish

In bash, if I run kill %1, it kills a backgrounded command in the current shell (the most recent one, I believe). Is there an equivalent of this in fish? I haven't been able to find it online in a bit ...
3 votes
2 answers
947 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 ...
-1 votes
1 answer
487 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 ...
2 votes
2 answers
333 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 ...
0 votes
0 answers
900 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 ...
0 votes
1 answer
89 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 ...
19 votes
3 answers
10k views

How to access bash aliases in fish

I am missing my bash aliases in fish, and don't want to manually convert all of them to fish functions. How to get access to them all from within fish? Bonus points if: the solution supports an ...
4 votes
1 answer
269 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 ...
0 votes
1 answer
117 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 ...
0 votes
0 answers
513 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....
1 vote
1 answer
121 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 ...
1 vote
1 answer
180 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 ...
2 votes
2 answers
3k 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?
0 votes
1 answer
198 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 ...
0 votes
3 answers
2k views

Temporarily Set $PATH for a fish Shell Session From a Script

I want to prepend a couple directories to the $PATH variable temporarily so that I can set up a temporary development environment that I don't really want to change what other fish sessions see. So ...
0 votes
1 answer
375 views

Terminal prompts have a mysterious [I] in it

I have been using fish shell for a while, but only recently got into playing around with the oh-my-fish framework and theming the prompt. I cannot figure out what this [I] character means! In most ...
0 votes
1 answer
97 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.
51 votes
3 answers
60k views

How to make zsh completion show the first guess on the same line (like fish's)?

In Fish when you start typing, autocompletion automatically shows the first autocompleted guess on the line itself. In zsh you have to hit tab, and it shows the autocompletion below. Is there anyway ...
0 votes
1 answer
78 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 ...
5 votes
3 answers
5k views

How to use fish on remote servers that have it installed without changing login shell?

I regularly ssh on several different servers, some of which don't have fish installed, but many do. I'd like to get fish as shell if available (changing midway is always tedious, and you lose the ...
1 vote
1 answer
165 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 ...
-1 votes
3 answers
4k 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 ...
0 votes
1 answer
1k 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 ...
1 vote
1 answer
607 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 ...
3 votes
0 answers
368 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 ...
0 votes
2 answers
8k 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 ...
11 votes
2 answers
12k views

How does history work in fish shell?

I'm a bash user, starting a new job at a place where people use fish shell. I'm looking at the history command which I often use in bash. When I use it in fish I get a long list of my history which ...
1 vote
2 answers
168 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?
-1 votes
2 answers
299 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 ...
3 votes
1 answer
277 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 ...

1
2 3 4 5