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
1
vote
1answer
25 views

tmux run a pipe/chain of commands with keybinding

How can I run a chain of command like in shells with tmux? I want to run multiple commands based on success of them. I want to echo out to terminal (or command bar) E.g. I have a keybinding to reload ...
8
votes
3answers
11k 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
0answers
328 views

How to install nerdtree vim plugin in a fish shell?

Iḿ trying to install nerdtree vim plugin in my fish shell, but I'm still getting the same error: line 76: E117: Unknown function: nerdtree#runningCygwin E15: Invalid expression: !nerdtree#...
7
votes
2answers
7k views

Is there a way to “source” a sh script from the fish shell?

I like to put many of my environment variable definitions in the .profile script. If I am using a POSIX-compatible interactive shell like bash, I can use the source command to re-export the ...
3
votes
1answer
45 views

/bin/bash shell (macOS) throwing `-bash: declare: -A: invalid option` error message at shell start

I briefly changed my default shell on macOS Catalina (10.15.1) to Fish, following the steps in Fish's documentation. First, I executed > echo /usr/local/bin/fish | sudo tee -a /etc/shells followed ...
1
vote
1answer
37 views

Is there a Fish equivalent to “bash --rcfile ~/.bashrc”

I've just moved over to fish shell after years of Bash. I've ported all of my functions over pretty easily except for a very simple one I have called mkroot: mkroot () { sudo bash --rcfile ~/...
12
votes
4answers
11k 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" ...
1
vote
1answer
65 views

how to enable command line navigation shortcuts in fish shell running in iTerm on Mac

Setup: MacOs Mojave, iTerm, Fish shell 3.0.2, using fisher have theme bob-the-fish installed as well. Would like to be able to use command line navigation keyboard shortcuts such as ctrl-A to get t ...
6
votes
1answer
669 views

Why is it not recommended to set the default shell of the root user 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 the kernel or other things in the system have a ...
4
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?
0
votes
0answers
25 views

Fish: Pipe into process substitution

In Bash, you can do the following to send a process's output to another process's STDIN while printing it to console. echo 'Hello, world!' | tee >($command) What is the equivalent in Fish?
2
votes
2answers
762 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 ...
0
votes
1answer
174 views

How to refer to absolute paths in fish?

I'm trying to get fish to recognize an absolute path, either when changing directories or when giving an input to a program. I'm used to typing an absolute path as "C:/..." but in fish the only way I ...
1
vote
1answer
578 views

tmux.conf is giving syntax error

My .tmux.conf is # https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf set-option -g status-style bg=colour235,fg=colour136,default # bg=base02, fg=yellow # set window ...
22
votes
4answers
8k 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-...
0
votes
1answer
323 views

i3wm urxvt wrapping issue when using hot key to launch. no issue when run from dmenu

Sorry for the long title. Wanted it be a little specific. I have an issue with my urxvt (rxvt-unicode) terminal emulator that's using a themed fish shell. The problem is that when I launch urxvt with ...
1
vote
1answer
40 views

Fish: Concise way to output elements of list on separate lines

I am wondering if there is a concise way to output the elements of a fish list on separate lines. I know I can do e.g. echo $PATH | tr ' ' '\n' to achieve the desired output, e.g.: /usr/local/sbin /...
1
vote
1answer
53 views

Redirect Streams

I am trying to redirect the results of rg to comm to compare the match intersection. Fish seems to think that I will be passing a file path and and not the stream. > comm -12 <(rg -l "\\bar\\b" ...
0
votes
0answers
21 views

UPDATED: Need pointers/help debugging latency issues related to command history recall in fish when used within intellij's terminal

Update-1: The problem does not seem to exist in Intellij 2019.1.4 but does in 2019.2.4. There is some incompatibility/issue when using fish as the terminal shell command in jetbrains ide's. in some ...
4
votes
1answer
107 views

What's the easiest way to prepend the current time to the fish prompt?

I'd like to see the current time in my fish prompt so that I can always see for example when I started the last command. I don't want to install extensions.
1
vote
0answers
39 views

fish prompt returns to defaults after change in fish_config

I've been using Fish for a while and after installing Oh-My-Fish the prompt changed to the default OMF prompt. And I couldn't change to what I was using before, one of the default Fish prompts called "...
0
votes
1answer
79 views

Why might I not see stty key changes reflected in “stty -a”

I'm trying to change some key bindings in my console (Konsole). If I map intr to Ctrl-k, by running stty intr \^k I don't see the change reflected in stty -a speed 38400 baud; rows 46; columns 172;...
0
votes
1answer
133 views

How to copy fish config files to remote computer?

I am looking for instructions or a script to copy my fish config files to a new computer via scp. Or at least build a tar file with all of them.
3
votes
1answer
129 views

Fish Shell - can't find where “la” is defined as “ls -la”

On both my Mac and Ubuntu when I type "la" in Fish Shell I receive output identical to that from "ls -la". I thought I might have defined it as a function. However, I can not find "la" being defined ...
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 ...
46
votes
3answers
27k 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 ...
1
vote
1answer
853 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 ...
37
votes
6answers
11k 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
77 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
86 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 /...
10
votes
4answers
5k 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 ...
1
vote
1answer
241 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
80 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
267 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 ...
0
votes
2answers
882 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) %(...
2
votes
1answer
383 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
71 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 ...
32
votes
5answers
9k 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
843 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 ...
1
vote
1answer
2k 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
466 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 ...
2
votes
1answer
227 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
35 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....
36
votes
9answers
23k 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
464 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
107 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 $...
98
votes
2answers
28k 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
313 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
388 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 -)" ...
5
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). ...