Questions tagged [fish]

The friendly interactive shell (fish) is a Unix shell that focuses on interactive use, discoverability, and user friendliness.

Filter by
Sorted by
Tagged with
9
votes
3answers
8k 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" ...
40
votes
3answers
20k 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
1answer
47 views

Installing Homebrew with fish-shell

I recently had a mishap with MySQL and when I uninstalled it from System Preferences it uninstalled Homebrew as well (I checked the erase all files that are related to MySQL, which was probably not ...
36
votes
6answers
9k 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 ...
1
vote
1answer
52 views

vim displays rbg codes in quickfix bar before error output

Recently I've started using :make and various other commands that make use of the quickfix bar. However the output it produces has this initial line of an escape character and rgb codes. I was able ...
0
votes
0answers
45 views

Can't find command after setting PATH in fish

I'm struggling to add /usr/local/bin to my PATH so I can use geckodriver, which is located in /usr/local/bin/geckodriver. I tried the to add the following to my config.fish set -U fish_user_paths /...
9
votes
4answers
3k 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 ...
3
votes
1answer
2k views

“set -xe” in fish shell

In bash, invoking set -x at the beginning of a script causes the commands to be printed on stdout while the script is executing. What's the equivalent syntax for the fish shell?
1
vote
1answer
55 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 ...
1
vote
1answer
38 views

Fish generated Rsync command has unexpected effects

I am using fish shell and I have a helper function to generate a rsync command with my parameters all set. The final rsync command should be like this (the command is in one line, I made it multiline ...
2
votes
1answer
73 views

How to Expand Abbreviations Inline in Fish Shell?

I'm trying to save some time in Fish Shell by setting an abbreviation (nu) to expand to the string: my-username@my-ip-address:/home/my-username What I'm hoping to achieve is to enter: scp some-file ...
3
votes
3answers
16k views

Running the output of `ssh-agent` in fish; what does `setenv` do?

When I want to start (or restart) ssh-agent, it gives me a few commands that I should run by doing eval $(ssh-agent). Of course this fails for fish, since it gives syntax for bash or csh. The ...
2
votes
1answer
167 views

Powerline and Fish: How can I remove the large whitespace between the shell prompt and cursor?

I recently started using Arch Linux and just installed Powerline and Fish (version 3.0.0) last week. In my terminal, which is Termite (version 14), there's a large (horizontal) space between the shell ...
6
votes
2answers
7k views

Reuse .bash_profile for Fish in Mac

I'm using iTerm on my Mac and I have a .bash_profile that I have been comfortably using. I recently got to know about fish bash and I installed it on my Mac and all of a sudden my .bash_profile is not ...
0
votes
2answers
163 views

Running command for bash in fish shell

I'm trying to identify all the large files in my git repo history and came across this command posted here. git rev-list --objects --all \ | git cat-file --batch-check='%(objecttype) %(objectname) %(...
1
vote
1answer
114 views

How to combine the output of multiple commands in fish?

Say I want to send the output of to commands into another. cat a.txt && ls I can do this: fish -c "cat a.txt && ls" | another_command But it seems clunky, is there a way to do this ...
0
votes
1answer
38 views

Do not store failed commands in fish history

I was wondering if it is possible to avoid storing commands in fish history which have failed. At the moment I e.g. have commands like :q stored in my fish history, because I accidentally typed that ...
28
votes
5answers
7k 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 ...
0
votes
1answer
181 views

Fish Shell: remapping VI-mode keybindings

I want to remap some of the default movement bindings in fish's vi-mode (I'm using version 3.0). Specifically I want to change the $ and ^ key mappings to be E and B respectively to match what I use ...
0
votes
0answers
110 views

Fish and miniconda shell error

Not remotely a power user at all, I got stumped when my shell (which has been working just fine for months) started giving me this output: Last login: Tue Feb 5 08:26:33 on ttys002 Welcome to fish, ...
0
votes
1answer
252 views

How to set a specific version of Java as JAVA_HOME in Fish in macOS

I was using Bash as my default shell on macOS but I decided to switch to Fish. I am trying to switch between different versions of Java. In bash it was done using the ~/.bash_profile export ...
3
votes
1answer
328 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 ...
1
vote
1answer
46 views

Fish Shell - Virtualenv path not prepended to PATH

I am on a Mac running macOS Mojave. I run Iterm2 for terminal and fish version 3.0.0. I also use pipenv to manage my local development. I have this problem where when I activate a python virtual env, ...
2
votes
1answer
26 views

Void folder is taking megabytes of space in OSX

xxx@MacBook- ~/D/p/a/Project5_min> du -sh * 2.6M app 4.0K build.gradle 60K gradle 4.0K gradle.properties 8.0K gradlew 4.0K gradlew.bat 4.0K instruction.txt 4.0K local....
0
votes
0answers
31 views

How to make fish completion case sensitive?

Currently when typing in a path or command, fish will suggest completions even when the case doesn't match. Can this functionality be disabled?
31
votes
9answers
17k 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 ...
1
vote
2answers
109 views

Failed to login after setting fish as default shell

I tried fish for a while, and then i wanted to set it as my default shell. I edited /etc/passwd and changed the shell of my user to /bin/fish. The problem is I couldn't login anymore. I tried through ...
0
votes
1answer
53 views

Fish commandline: get cursor position in current process

With fish commandline command I can get current process part of commandline and current cursor position in entire buffer, but not in current process, e.g for commandline buffer > echo test; echo $...
92
votes
2answers
25k views

chain Fish commands via `&&` or `||`

In Bash/ZSH and other shells, I am used to using && and ||. Is there any equivalent in Fish?
0
votes
1answer
138 views

How can I fix this error when trying to install Oh-My-Fish?

I am using fish via Cygwin on Windows 10; whenever I try to install OMF, I am presented with this error: curl -L https://get.oh-my.fish | fish.exe % Total % Received % Xferd Average Speed ...
1
vote
2answers
292 views

Using rbenv with the fish shell

When using the recommanded way to setup rbenv, `eval "$(rbenv init -)", I get: $(...) is not supported. In fish, please use '(rbenv)'. ~/.config/fish/config.fish (line 5): eval "$(rbenv init -)" ...
4
votes
2answers
2k views

Fish terminal + iTerm, only run shell integration if terminal is iTerm

iTerm has a shell integration script that enables some fancy features, as in having the ability to scroll up to last prompt (in case if there was a lot of stdout i.e. when compiling some code). ...
1
vote
1answer
40 views

Wrap command with options in fish function

Is there a way to wrap a command with options in a function, so that completions for that command with the options are shown? For example, I want to be able to do this: function remove --wraps='...
1
vote
1answer
34 views

Setup different path for fish shell temporally

User libraries are normally in /usr/local/lib. However I want to build some third party libraries in for example /Users/user/Public/lib. I only want to do it during my testing. Is there a elegant way ...
5
votes
3answers
5k views

How to get Fish shell and NVM both installed with Homebrew to work together?

I am trying to manage my packages for OSX using Homebrew as much a I can. I have installed both the Fish Shell and NVM using Homebrew but cannot get Fish to recognize my NVM installation. NVM ...
12
votes
3answers
6k views

How do I change EDITOR to be Pico in fish shell?

I can’t get Mercurial (hg) to use pico as my EDITOR when I’m using fish shell. I’ve tried using this and other variations, but nothing seems to help: set -U EDITOR pico hg commit will always open ...
1
vote
1answer
199 views

how to open tcp connection in fish shell

I am looking for a way to open TCP connections in fish shell. In bash, I can do the following to open a TCP connection. This is quick telnet type test when telnet is not installed. $ echo > /dev/...
0
votes
1answer
112 views

Difference between set -g and set -x

I'm currently migrating from bash configs over to fish and got stuck translating my over bash exports. It seems there's three ways to do it in Fish that get the job done but I can't tell which one I ...
1
vote
0answers
43 views

fish shell, enter long command

Given the usual size of the terminal window, short commands fit. Ex: stoqlt@desktop:~ > ls files However, typing a command that is longer than the free space after the prompt, and reaching the end ...
0
votes
1answer
9k views

How can I setup fish shell prompt to be in a different color?

I've seen a screenshot of zsh configured to have prompt with a different color and background, and it looks like a very usable tweak:
4
votes
1answer
366 views

Why it is not recommend to set default shell for root uset to a non-POSIX shell?

I am going to change my root’s default shell from bash to fish. As far as I know, fish is a not a POSIX standard shell. On the other hand, maybe kernel or other things in the system have a relation ...
1
vote
1answer
49 views

Issue with wrong command entered in fish-shell and it's output

Actually I am using fish these days and I completely switched from bash to fish (with chsh & terminal startup command) but the matter is when I enter a wrong command e.g. qwerty its output is: ...
3
votes
2answers
2k views

Change prompt on command line?

My prompt is quite verbose - which is good most of the time - but now I would like to switch it temporarily because I want to make a screen shot of the terminal. For that purpose I would prefer not to ...
0
votes
1answer
136 views

How to start a fish instance with a specific `config.fish`?

I want to start a particular fish instance with a specific config.fish. Something along the lines of the Bash --rcfile option. I'm aware of the XDG_CONFIG_HOME variable. But I just want to switch ...
2
votes
1answer
167 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 ...
3
votes
2answers
1k views

What's causing the file is not executable by user on the windows subsystem for linux?

This seems to have randomly started a few days ago. It used to be fine to run fish shell from Ubuntu bash for Windows. But suddenly when I hit Tab for autocomplete, it barfs with: The file "x86" is ...
0
votes
1answer
191 views

Fish shell doesn't return program error

In bash, if I run a program and it crashes I get some information about what went wrong, such as Segmentation fault (core dumped). In fish, I just get fish: but no message... does anyone know what the ...
1
vote
1answer
118 views

Two questions about adding custom content to config.fish

I have a question about the Fish (Friendly Interactive SHell), so I hope somebody can help me out. Basically I'd like to customize the fish_greeting message. I can easily get it to say anything I'd ...
0
votes
1answer
434 views

Reveal user@hostname in oh-my-fish theme

I'm trying to have the user@hostname displayed all the time in fish's bobthefish theme, no matter whether you're the default user or not. I've tried editing ~/.config/fish/functions/fish_prompt.fish, ...
18
votes
3answers
6k 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-...