Why does the or operator in fish seem to not work
function shapeshift argparse 'h/help' -- $argv if not set -q argv[1] $argv or if set -q _flag_help echo "Shapeshift lets you change into another root system." echo "It is a simple tool that mounts, and...
View ArticleFish shell: how to disable "git status" in prompt?
I love Fish shows me "git status" in the prompt. However, it doesn't work well for really large git repos because it's very slow. How can I disable this feature based on the directory's name? Thanks!
View ArticleFish shell: how to exit on error (bash set -e)
On bash you can use set -e inside a script in order to exit on error:set -ecd unexisting-folderecho "this line will not be printed"But on fish shell set -e is used to erase variables:set FOO barset -e...
View ArticleCan a Fish script tell what directory it's stored in?
So, I really like Fish - but I need some help with scripting. and in particular finding the path of the script being run.Here is the solution for BASHGetting the source directory of a Bash script from...
View ArticleFish Shell: How can I customize the colors for the autocomplete feature?
I started using Fish (and oh-my-fish) a couple of weeks ago and one of the things that I find somewhat visually hard is the default background color of the autocomplete options (see the purple...
View ArticleIs it possible to setup FISH alias based on different OS or available command?
I see Define an alias in fish shell, and I know how to setup alias and/or functions,But is it possible to setup different alias target based on OS? Maybe use function?What I experience isn't standard I...
View ArticleHow to use bash functions with fish
I have few bash functions like#!/bin/shgit-ci() { ...}When I was not using fish I had a source ~/.my_functions line in my ~/.bash_profile but now it doesn't work.Can I use my bash functions with fish?...
View ArticleHow to set environment variables in fish shell
Can someone please tell me what's the correct way to set a bunch of environment variables in the fish shell?In my ~/.config/fish/config.fish file, I have a function to setup my environment variables...
View ArticleHow to change the ssh connection shell of pycharm on windows to the default...
I installed the fish shell on my server, but I found that it seems to be detrimental to my ability to connect to the server with ssh. When I connect to the server and run it, debugging the code,...
View ArticleFish Pipeline Status
In fish:if false | true | true echo "Fish thinks OK because of last status"else # But I... echo "Need the entire pipeline to be true"endBash has $PIPESTATUS.How does one test the integrity of a...
View ArticleHow to show content of a function in fish?
In fishshell, I can create and save a function very easy, like: function aaa echo helloendfuncsave aaaBut how to view the body of the function aaa from command line easily? Is there any way other...
View ArticleFISH Shell - Cannot `cd -` when extending builtin cd
I have a custom cd function that looks like:function cd -d "cd with auto conda activation" # set -gx OLDPWD (pwd) <-- uncommenting this does not resolve issue builtin cd $param $argv if test -f...
View ArticleMulti-line variables remove new line character - Fish
When I set any multiline text as a variable in fish, it removes the new line characters and replaces them with space, how can I stop it from doing that? Minimal complete example:~ ) set lines (cat...
View ArticleHow to pipe on a condition in Fish?
See previous question, How to pipe on a condition in Bash. I'm interested in the same construct for Fish, i.e. shorthand for:set check 0if test $check = 1 printf "foo\nbar\nbaz\n" | string match...
View ArticleHow can I fix Edit cancelled, no changes made in shell
I runkubectl edit deploymentto change the version of one of my pods (this commands opens a temp file in my text editor and then I usually edit and close this temp file) and even before I close this...
View ArticleCan I use nvim --remote to replace nvr?
I'm using neovim-remote/nvr to avoid nested instances of nvim when using the integrated terminal. This is the code:# config.fishif set -q NVIM # Avoid nested neovim instances with neovim-remote set -gx...
View ArticleAppend *multiple* paths to PYTHONPATH in fish
Here I read how to append to PYTHONPATH in fish, and that works fine for one string.However, if I do this:set --export PYTHONPATH $PYTHONPATH path1 path2I get this:>> import os>>...
View ArticleIs there a way to have fish-shell use GNU coreutils printf function?
Ran into an issue when running the following command in a fish shell:❯ printf '%q\n''André Previn & London Symphony Orchestra'%q: invalid conversion specificationI hadn't realized at first that...
View ArticleHow to stop Fish shell store critical information
I really like fish auto completion but I don't want to store any parameters in it, I know I can use --private or -P, but it only remove the history only when the terminal closed.How to make sure fish...
View ArticleHow to bind a key to just another key in fish
I am trying to bind the key sequence control-h (\ch in fish) to the right arrow key. I know how to bind it to backward-char with bind the normal way, but that poses an issue in my config, since I have...
View Article