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
0
votes
0answers
25 views

Is it possible to have an abbreviation in a shell anywhere in a command?

I have a directory which has a really long path. However, I use this directory constantly and I cannot move it (WSL Windows directory). I generally use z to jump around to it quickly which is useful, ...
1
vote
1answer
24 views

distinguish C-i from Tab in Fish?

My fish configuration contains following bindings: bind \ci nextd-or-forward-word bind \co prevd-or-backward-word bind \t complete When I comment out complete then directory navigation to works as ...
3
votes
3answers
1k 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
0answers
39 views

How to enable Fish shell themes from ssh connection

So, I’m learning to transition to using the Fish shell. I’ve only ever used the Bash shell, but I’ve enjoyed using Fish. I found this custom shell theme called “Shellder” (https://github.com/...
40
votes
8answers
14k 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
71 views

fish shell outputs ⏎ (i.e. an “abandon line”) during startup on smaller terminal sizes

Whenever I open a new terminal window (that's <100 columns wide) Fish prompts me with: ⏎ foo@bar ~> I'm not expecting that first line with ⏎ to appear! If it's 100 columns or wider, then this ...
0
votes
1answer
23 views

How do i pass function parameter as string in fish shell

Octave has an --eval option that takes a sting like "sqrt(4)" and outputs "ans = 2". I want to create a function that passes the a parameter as string so i can call it like this: ...
0
votes
0answers
31 views

OhMyFish does not show the hostname and computer name

OhMyFish does not show the hostname and computer name by default. screenshot Is there any way to change this setting so that it shows the hostname and computer name like how it is shown in the default ...
1
vote
1answer
35 views

Why fish shell does not allow function named `-`

I am trying to use fish as my default interactive shell. I was previously using bash and there was support for alias named - (ASCII hyphen, 0x2d). Why does not fish allow creation of alias or function ...
1
vote
1answer
42 views

How to I persist prepended items to PATH in fish shell?

My PATH Prefixes Don't Persist I'm using Fish v3.2.0. According to the documentation, set -U fish_user_paths should persistently ensure that the directories stored in it should be looked up before ...
13
votes
2answers
8k views

How to do command substitution in fish shell?

How would a command like this have to be expressed in fish? ls -l $(which vim)
53
votes
3answers
33k 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
47 views

Run the current command and pipe the output to fzf

What would be an easy way to bind a key binding from fish to run the current command prompt and pipe it to fzf for easy search/selection? i.e. a 1 key-press way of accomplishing | fzf (enter)?
0
votes
0answers
31 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 ...
3
votes
2answers
68 views

How can I ask `fish` to enumerate all the locations it's reading configuration from?

When I start fish, I'd like it to print every location it's reading configuration, profiles, and customizations from, so that I can: understand which specific paths I need to backup if I want to ...
1
vote
1answer
150 views

Minimal Backup of Fish Shell Config

Thanks to the influence of many, including one who has a passing association to a certain green tinged distro I have moved over to fish (from zsh). However config is quite different and I couldn't ...
35
votes
6answers
11k 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 ...
3
votes
1answer
134 views

Is there a fish way of doing zsh's noglob builtin?

From https://linux.die.net/man/1/zshmisc : noglob Filename generation (globbing) is not performed on any of the words. zsh example: $ ls /* <lots of output> $ noglob ls /* ls: cannot access '/...
5
votes
2answers
188 views

Where is the best place to add an “ssh-add” command in fish shell startup?

At some point I added an ssh-add invocation to my config.fish file. So every time I open a terminal, that runs for a couple of seconds. Is there a better place to set this, so that it runs upon login? ...
9
votes
2answers
9k 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 ...
0
votes
0answers
376 views

MobaXTerm “Follow Terminal Folder” STFP & Fish Shell

MobaXterm's "Follow Terminal Folder"/"Follow SSH Path" feature works great when remote SSH into a linux computer, it shows directory & files to the left as you work in the ...
43
votes
9answers
27k 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 ...
2
votes
2answers
111 views

Execute two or more commands simultaneously in shell script

It is often very helpful to run commands in parallel in a shell script, but I cannot find ways to do it. Is this possible? If so, how would I achieve that? I'm mainly interested in doing that for fish....
1
vote
1answer
44 views

Change the startup directory to something other than HOME

By default, when I open the fish shell, my working directory is the home directory. Is there a way to change the default working directory on startup, without having to edit the HOME variable?
1
vote
1answer
85 views

How can I change the prompt to always show the current path?

I want to continue using the fish shell with as little changes to default setup as possible. But there is one thing that really bugs me. When the terminal window is cramped the prompt just becomes >...
2
votes
2answers
3k 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 ...
10
votes
1answer
3k views

Where does fish_config save its settings?

I've used the fish_config utility to customize my syntax color scheme and now I want to copy these settings to remote servers I can't run fish_config on. Where does it save the changes made through ...
1
vote
1answer
193 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
14k 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 ...
3
votes
1answer
280 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 ...
2
votes
1answer
190 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 ~/...
15
votes
4answers
14k 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
299 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
843 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 ...
5
votes
1answer
3k 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
1answer
193 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 ...
2
votes
1answer
2k 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 ...
24
votes
4answers
10k 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
348 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
47 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
84 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" ...
4
votes
1answer
322 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
53 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
126 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
285 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
228 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 ...
2
votes
1answer
3k 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 ...
1
vote
1answer
87 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
111 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 /...