Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [fish]

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

0
votes
0answers
29 views

Fish shell not clearing history completely when starting

EDIT: I figured out what went wrong! The root cause of it was my .bash_history file; that contained the commands! I've configured my fish shell to clear my fish history (because of personal ...
1
vote
0answers
6 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='...
0
votes
1answer
21 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 ...
3
votes
3answers
4k 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 ...
9
votes
3answers
5k 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 ...
0
votes
0answers
20 views

byobu-launcher-install ignoring no-logout option

My Current config : MacOS High Sierra, Terminal.app, fish shell. byobu-launcher-install -n Issue: When I try to detach from byobu using 'ctrl-a, d' byobu detaches and fish shell session exits along ...
1
vote
1answer
104 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
53 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
36 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
7k 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:
3
votes
1answer
147 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
35 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
1k 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 ...
24
votes
8answers
13k 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 ...
0
votes
1answer
71 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 ...
3
votes
1answer
51 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
1answer
4k 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 ...
6
votes
4answers
2k 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 ...
4
votes
2answers
640 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
106 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
62 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
314 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, ...
0
votes
0answers
107 views

Fish shell not using variable scoped with Direnv within Git aliases

I am using Fish shell [1] and Direnv [2], and are having issues with variable scope when using Git aliases. For example in my config.fish [3] I have a global environment variable e.g. $GIT_MY_EMAIL: ...
13
votes
3answers
4k 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-...
6
votes
1answer
642 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 ...
5
votes
1answer
4k views

How to keep terminal window title in sync with tmux window

I am using a program called "Timing" to track my time. Timing uses the name of the current window in iTerm for categorization purposes. I'd like to set the current title of iTerm to match the name of ...
2
votes
2answers
1k views

Make bash as close to fish as possible

I love the fish shell and use it exclusively in MacOS but I use bash everywhere else because its the only thing installed. Having felt the pain of maintaining configuration files for the two shells, I'...
3
votes
2answers
3k 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 ...
1
vote
1answer
60 views

Change the color of the omitted newline char in fish shell

Is there any way to change the color of the "⏎" sign after output of echo -n a (or any command which doesn't have \n at the end of the result)? It's unreadable if using black background. There is an ...
0
votes
1answer
85 views

Error on iTerm2 fish shell load: `function: Illegal function name '-v'`

On iTerm2 load: Last login: ... on ... function: Illegal function name '-v' ~/.iterm2_shell_integration.fish (line 86): function -v _ underscore_change if [ x$_ = xfish ] ...
1
vote
1answer
139 views

What, if any, is the equivalent of bash's select…in…do..done in fish?

I had finessed in bash a function that changes to any directory below the current working directory by having that directory name as a parameter to the function. If there are multiple results by that ...
25
votes
5answers
5k 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 ...
2
votes
1answer
582 views

How to chain a group of commands in Fish like { … } Bash?

I'm aware of chain Fish commands via && or || but I'm willing to chain a set of commands Code env git clone --depth=1 https://github.com/rafaelrinaldi/theme-pure.git; or { printf "Error: ...
1
vote
0answers
142 views

Why does fish shell create a hidden process in iTerm2

I've moved from bash to fish shell in iTerm2. However, whenever I start iTerm2, I receive the following error message: A session ended very soon after starting. Check that the command in profile ...
2
votes
1answer
273 views

Using Fish + NVM + Sublime results in commands not found

I'm using Fish shell/omf, NVM (https://github.com/derekstavis/plugin-nvm), and Sublime Text 3. I'm trying to use a build system to run nodemon (which I installed with npm -g install nodemon). nodemon ...
1
vote
1answer
992 views

Change color of hostname in Fish shell prompt

I'm migrating to a new Mac, and I'm having trouble setting up my shell to match the old one. Old: New: Notice the host color is different? I copied the entire .config/fish folder over to the ...
0
votes
1answer
172 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
votes
1answer
330 views

fish shell how do you check for root

Is there a way to assert the current "user" is root (i.e. the script was run by root) using the fish shell? I know for bash you can check the EUID
3
votes
2answers
52 views

Combining functions in Fish

In Fish shell I have two functions: function be bundle exec $argv end function rdbm rake db:migrate end I typically use them together, i.e. bundle exec rake db:migrate but not always, so I'd ...
2
votes
1answer
111 views

How to get fish-style formatting with less

Let's say I run a command like ls in fish and get lots of output, how do I scroll through it and still keep the fish formatting or something like it? ls | less doesn't keep the formatting. I know ...
27
votes
4answers
7k 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 ...
0
votes
1answer
443 views

How to show fish shell completions in a menu and window pressing tab

Currently fish shell (2.3.1) shows the completion list after pressing Tab. You can navigate through the list using the arrow keys or Tab. If possible, how can I show the completion list in a pop menu ...
9
votes
2answers
5k views

How do I install/make a custom prompt for fish shell?

I'm using fish 2.0 in #! Linux, but this might be an installation error, since my ~/.config/fish/config.fish is empty.
8
votes
3answers
7k 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" ...
0
votes
1answer
116 views

Bad fish configuration preventing usable login to remote server

I messed up configuring my config.fish, and I now cannot use my server. Whenever I try to log in, it says fish: Unknown command '/usr/bin/keychain /home/freebsd/.ssh/id_dsa' /home/freebsd/.config/...
2
votes
1answer
435 views

PYTHONPATH Getting set in Bash Shell to incorrect value

OS: macOS Sierra Beta 6 Python: 2.7 Shell: Fish I am having issues with my PYTHONPATH environmental variable being set correctly. In my fish_config file, I have this line setting up PYTHONPATH: set ...
3
votes
2answers
2k views

How can I do string manipulation in fish shell

How can I do bash style string manipulations in Fish shell? Specifically, in bash read branch < ".git/HEAD" branch=${branch#ref: refs/heads/} will put the branch name in $branch variable. How ...
4
votes
5answers
2k views

fish control-left control-right keybindings

I'm using terminator along with fish and I want to use Alt-Left etc for navigating terminator and Ctrl-Left and Ctrl-right to move the cursor by word. The problem is when I do bind \cleft backward-...
1
vote
0answers
201 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 ...
0
votes
2answers
46 views

Very weird directory when editing a function in Fish

I am just curious what the meaning is of this bizarre directory from which atom is launched to edit a function from the Fish shell. Anyone have any idea?