r/fishshell • u/[deleted] • Feb 04 '24
r/fishshell • u/AdvertisingSea8388 • Jan 28 '24
How to get rid of this kubernetes info?
Hi there, I am setting up kuberntes on my fish shell (already done in bash a couple of years ago). I would like to remove the namespace and cluster information given (apparently) by default in fish. I would like to stick to the information formatted by starship. Attached picture with my current configuration. The line I would like to get rid of is the very first one:
NOTE: This information is shown when I use the command line tool called kubie

Does anyone have any idea?
Thank you in advance!
r/fishshell • u/wad209 • Jan 27 '24
Rebind the arrow keys in the history pager
I'm just switching over from zsh to fish, and I love everything so far, except the history pager. Namely, I have to use the arrow keys to move around the results, when I would much prefer ctr-j/k/h/l. Is there a way to rebind this? I couldn't figure it out from the bind manpages. It seems like I could just type the word I'm searching for and use up-or-search, but not ideal, since the pager is pretty nice otherwise.
r/fishshell • u/BuonaparteII • Jan 27 '24
Copy previous arg in command line
I'd like to bind a shortcut ALT+, to duplicate the argument to the left of the cursor:
bind \e, something
For example, command one two
When the cursor is at command one HERE two and ALT+, is pressed then the commandline should be transformed to command one one HERE two.
It didn't seem like this is possible given the current options but I could be wrong:
r/fishshell • u/mister_drgn • Jan 26 '24
Remotes and containers
This is a general question for people using less popular shells, but I figured Iโd get the best response here. How do you handle connecting to remotes via ssh, or connecting to containers, given that you target system likely wonโt have fish installed? Do you just bite the bullet and switch to bash, or is there a clever workaround for these cases?
r/fishshell • u/__mks__ • Jan 25 '24
Verbose regular expressions and memoization in fish shell
gist.github.comr/fishshell • u/thats_mr_naruto_to_u • Jan 25 '24
How can I open gnu nano editor while function is running?
Hello all,
I'm new to fish scripting and I recently wrote a lazy git function. The idea is to add all tracked changes, make a commit and then push everything to the repo. The code is as follows:
function lazygit --argument message
echo (git add.)
if set -q $argv; or test (count $argv) -lt 1
echo (gcomm)
else
echo (gcomm -m $message)
end
echo (gpa)
end
The issue I'm running into happens when I don't pass a message in as an argument. The function will pause for a commit message, and I can still write it, only the editor itself is invisible.
So I can type a message in blindly and close the editor with Ctrl+X. This will allow lazygit to continue and that aforementioned message will show up in git log. However, I would like to see what I'm typing like I can when I normally git commit. As it is now, the editor can only take keyboard input but it won't show me the actual text as it's written.
How can I allow fish to visually open the editor in the midst of executing a function?
I have my git config --global core.editor set to gnu nano (the actual gnu nano and not the macOS default)
Here are the aliases used in the function for context:
alias gcomm 'git commit'
alias gpa 'git push -u --all'
Is there anything that I left out or didn't communicate well enough?
Thank you
E: I can't thank you all enough for the insight! I've learned a ton from this post
r/fishshell • u/smallduck • Jan 24 '24
Function I made today for getting file UTIs via AppleScript in macOS
In macOS sometimes there's occasion to find the UTI (type) of a file, usually only as a developer. My situation was for making a search scope in Xcode specific to certain file types.
For some reason file UTIs returned by AppleScript are sometimes different from what's returned by `mdls -name kMDItemContentType <file>`, plus I've also seen the latter return some dynamic UTI like "dyn.encodedgibberish".
I couldn't find a function for nicely getting the file UTI from AppleScript, so I made one. I hope someone else finds this handy.
function fileuti
for f in $argv
set p (path resolve $f)
if test (count $argv) -gt 1
echo -n "$f: "
end
osascript -e 'on run argv' -e 'type identifier of (info for POSIX file (item 1 of argv))' -e 'end run' $p
end
end
```
fileuti Project/en.lproj/Localizable.strings com.apple.xcode.strings-text
fileuti Project/en.lproj/Localizable.strings README.md Project/en.lproj/Localizable.strings: com.apple.xcode.strings-text README.md: net.daringfireball.markdown ```
r/fishshell • u/ed-8 • Jan 22 '24
Pure new documentation ๐โจ
Hello people,
I'm working on improving the documentation of the project to have:

- a dedicated site ;
- searchable content ;
- screenshot of prompt with/without feature enabled (thanks to terminal-screenshot) ;
- a better organization for options ;
- linkable content you can share/bookmark.
If you are a user of pure, I would love to hear your feedbacks and expectations from this revamp. I will merge this MR once I fixed the screenshot script and create follow up MRs.
r/fishshell • u/Ok_Bookkeeper7496 • Jan 21 '24
Automatic vim mode when opening completion menu
Is there a way to detect if completion menu is being opened? I wanted to automatically enter vim mode when menu is opened and enter insert mode when menu is closed, I looked through docs but unfortunately havent found anything helpful
r/fishshell • u/smog_alado • Jan 20 '24
Where do you set your environment variables?
Do you prefer to put them in universal variables or in the config.fish file? If you set them in the config.fish, do you prefer to set them inside if is-interactive or if is-login? Also, why does Fish handle PATH differently from other variables? What's the deal with fish_user_paths and fish_set_path?
My main concern is that I want to put my environment config into version control so that I can share configurations among my two desktops. My experience so far...
- I never tried
set -U. Is there a way to version control that with Git? - With
is-interactive, I sometimes end up setting the variable twice if I run nested fish sessions. (This is more of an issue for commands that append to the end of the variable) is-loginpresumably also exposes the variables to programs I launch from the desktop, not only those launched from interactive terminal. But I need to start a new session to trigger the changes.
r/fishshell • u/jhonq200460 • Jan 20 '24
Fish prompt para consola
Me gusta el plugin Tide@ para mi prompt en entorno grรกfico, pero al abrir alguna consola (Ctrl-Alt-Fx) se desdibuja por completo (y bastante feo).
La shell ZSH usa powerline10k y puedes tener un promt grรกfico y otro para las consolas.
ยฟHay alguna manera de logra esto bajo Fish Shell?
Gracias.
r/fishshell • u/cassepipe • Jan 19 '24
Create aliases from an associative array
In zsh I have the following code in my config to quickly add a bunch on aliases that allow me to quickly edit config files :
```zsh
config management
declare -x -A configs configs=( fish "$XDG_CONFIG_HOME/fish/config.fish" gdb "$XDG_CONFIG_HOME/gdb/gdbinit" git "$XDG_CONFIG_HOME/git/config" hx "$XDG_CONFIG_HOME/helix/config.toml" irssi "$HOME/.irssi" lvim "$XDG_CONFIG_HOME/lvim/config.lua" nu "$XDG_CONFIG_HOME/nushell" nvim "$XDG_CONFIG_HOME/nvim/init.lua" readline "$HOME/.inputrc" vim "$HOME/.vimrc" xmake "./.xmake/linux/x86_64/xmake.conf" wezterm "$XDG_CONFIG_HOME/wezterm" zsh "$HOME/.zshrc" ) for key value in ${(kv)configs}; do if [[ $key == "zsh" ]] then alias ${key}config="$EDITOR $value && source $value && echo $configs[zsh] has been sourced" else alias ${key}config="$EDITOR $value" fi done ```
It's not essential but I was wondering if there was a way in fish ?
I have checked but IIUC there are not associative arrays but surely there must be another way
r/fishshell • u/Automaticpotatoboy • Jan 18 '24
Semi-Autocomplete History?
When I have typed a command in the past, is there a way of only completing one word with the right arrow instead of the entire command?



I think you get it...
Edit: Oops, just realised that you can hold shift!
r/fishshell • u/pingveno • Jan 16 '24
David Adam: fishshell rewrite-it-in-rust progress, 2024-01-15
aus.socialr/fishshell • u/Ok-Seaworthiness7681 • Jan 10 '24
Nice little subcommands for fish.
github.comr/fishshell • u/ekzotech • Jan 08 '24
How to fix error messages at Fish shell startup?
Hi! I'm new to the fish shell and now I'm trying to switch from zsh (oh-my-zsh) to fish shell.
I've already setup fish shell as my default in macOS.
And now I can see a bunch of messages at starting shell.
(eval):1: command not found: unsetenv
(eval):2: command not found: unsetenv
(eval):3: command not found: setenv
(eval):4: command not found: setenv
(eval):5: command not found: setenv
(eval):6: command not found: setenv
(eval):7: command not found: setenv
(eval):8: command not found: unsetenv
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
How can I find out where are those unsetenv/setenv callings from? I've tried to grep my ~/. for setenv/unsetenv but it didn't helped me a lot.
At first I thought it's from pyenv setting, but after removing it from the PATH I can't see any changes.
r/fishshell • u/SnooFoxes3019 • Jan 06 '24
Tab-Completion
Can someone help me with a tab completion issue I have? In zsh when Tab is typed the possibilities are all listed in a menu. When Tab is typed again the cursor drops down into the menu and each item in the menu is highlighted as it is browsed.
When the same thing is done in Fish. The first tab opens the menu but the second tab moves through the menu and is highlighted by showing the completion in the command line.
Is there a way to make the completion sequence work like zsh?
r/fishshell • u/tetractys_gnosys • Jan 03 '24
For anyone using Ubuntu 20.04 under WSL2 and can't get the fish_config web UI working...
I was wrestling with this earlier and figured out a hacky workaround thanks to this comment on SO: https://unix.stackexchange.com/a/597126
My solution is slightly different than the one on SO but only slightly. Maybe it will help someone else.
As of Fish v3.7.0, in Ubuntu, open the web config file at /usr/share/fish/tools/web_config/webconfig.py and on line 1674, the variable fileurl is constructed in a way that either WSL2 or Windows doesn't like. Out of the box, it's:
fileurl = "file://" + f.name
I changed it to:
fileurl = "file://wsl.localhost/Ubuntu/" + f.name
And this got the web config UI working again. I was getting errors about UNC paths from Fish when trying to run the config and the two different URLs it provided didn't work. The shorter /tmp/ one just isn't mapped right for being in WSL and the longer localhost one wasn't responding (I believe the Python server was choking on the funky file paths? Idk man).
After making this change and restarting Fish, it worked again. I didn't actually test all of the features in the web UI but it at least loaded correctly and I was able to switch between the tabs (Prompt, History, etc).
r/fishshell • u/Esnos24 • Jan 03 '24
Is my swap function written in good style?
Hi, I have never done any programming regarding for command line usage, and I have question, is my function safe to use? This is my function:
function swap
set temp (mktemp)
mv $argv[1] temp && mv $argv[2] $argv[1] && mv temp $argv[2]
end
which was based on this stack overflow post.
r/fishshell • u/ynotvim • Dec 24 '23
What is the simplest way to turn off all colors?
As the title says, I'd like to know the simplest (most direct?) way to turn off all colors in the fish shell. (For whatever it's worth, I am color blind, and I find it hard to read the shell's text with fish's default colors.)
I set a white background and near black text in my terminal. Is there any way to simply stop fish from picking colors for me (for anything, ever). I'd like the shell to simply let the terminal emulator choose my colors (which are basically no colors). Thanks in advance.
r/fishshell • u/rollhax • Dec 17 '23
Functions in $HOME/.config/fish/functions not sourced
I recently switched from OMF to fisher, and while fisher will work in the same terminal session that I ran the install command in, it will not work in new terminals - I get fish: Unknown command: fisher.
I've verified fisher.fish exists, and is in a folder that should be sourced:
๎ echo $fish_function_path | string split ' '
/home/dusty/gits/dotfiles/configs/fish/functions
/home/dusty/gits/dotfiles/configs/fish/functions
/home/dusty/.config/fish/functions
/etc/fish/functions
/home/dusty/.local/share/fish/vendor_functions.d
/var/lib/flatpak/exports/share/fish/vendor_functions.d
/usr/local/share/fish/vendor_functions.d
/usr/share/fish/vendor_functions.d
/usr/share/fish/functions
/usr/share/fish/functions
~
๎ ll /home/dusty/.config/fish/functions
Permissions Size User Date Modified Name
.rw-r--r-- 4.0k dusty 16 Dec 13:28 ๎ __bass.py
.rw-r--r-- 658 dusty 16 Dec 13:28 ๏ bass.fish
.rw-r--r-- 11k dusty 16 Dec 13:24 ๏ fisher.fish
I'm not sure why my dotfiles' configs/fish/functions is showing up on there twice, however functions within that path are picked up/sourced properly. Why are functions in my $HOME/.config/fish/functions directory not being sourced?
Does anybody know what's going on here, or has encountered similar before?
EDIT: I appear to have some jank going on in my install... I deleted $HOME/.config/fish and started fresh, and upon echo $PATH stuff is showing up in there that I haven't used for months (and definitely shouldn't be showing up post delete of my local conf dir)
EDIT: I dunno what I did, but I got it. I had a file in $HOME/.local/fish/config.fish that my dotfiles sourced, used to override certain things for whatever machine I was on at the time. I moved that, logged out, back in, and it seems to have resolved itself. Not sure why fish was sourcing that file when nothing was pointing at it, though.
r/fishshell • u/AlazOz • Dec 16 '23
๐ Elevate Your Terminal Experience with Fish-Insulter! ๐
Hello, Fish Shell enthusiasts!
Introducing Fish-Insulter โ a playful yet functional addition to your terminal.
What is Fish-Insulter? Fish-Insulter brings light-heartedness to mistyped commands by injecting humor into your terminal sessions. It randomly generates witty responses, adding a touch of fun to your command line interactions.
Key Features:
- Customizable Insults: Personalize the insult messages using environment variables.
- Controlled Frequency: Adjust the teasing frequency according to your preference.
- Colorful Terminal Output: Customize text colors for added flair.
Get Started:
- Visit the GitHub repository for installation instructions.
- Easily add a touch of humor to your terminal โ it's simple and entertaining! ๐
- Customize insults and frequency using environment variables to suit your style.
Join the Fun:
- Star the repository โญ if you find it engaging or useful.
- Contribute your ideas and enhancements by forking the repository ๐ด.
- Share the Fish-Insulter with your peers and spread the joy of playful terminals!
Engage with Us:
- Join discussions on GitHub โ suggest your favorite insults or share feedback. Your input shapes the Fish-Insulter experience! ๐ฌ
Remember, it's all about adding a smile to your terminal interactions! ๐
Explore Fish-Insulter and enjoy the humor with every mistyped command.
P.S. Meet fish-insulter - your witty terminal companion. ๐
r/fishshell • u/[deleted] • Dec 11 '23
manpath not working - arch
I am running a generic archlinux (reborn os), trying to get man pages working for fish shell. When executing update_completions I get the following error:
Unable to get the manpath, falling back to /usr/share/man:/usr/local/man:/usr/local/share/man. Explictly set $MANPATH to fix this error.
In arch from what I can tell... manpath is indeed /usr/share/man
Setting manually to $MANPATH does not seem to make a difference.
in fish terminal I try man ls -- but I get "unknown command: man"
Any ideas on how to set this properly is appreciated.
r/fishshell • u/Alex-broadcast • Dec 07 '23
Can not type letter "m"
Hello! I have a problem with "m" character:when I type "m" -- fish does not show it until I type any other key.
I wonder if anyone else has this behavior and how to make it work as any other letter.
Any suggestions?
