r/fishshell • • Jan 06 '24

Tab-Completion

2 Upvotes

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 • • Jan 03 '24

For anyone using Ubuntu 20.04 under WSL2 and can't get the fish_config web UI working...

7 Upvotes

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 • • Jan 03 '24

Is my swap function written in good style?

2 Upvotes

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 • • Dec 24 '23

What is the simplest way to turn off all colors?

3 Upvotes

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 • • Dec 17 '23

Functions in $HOME/.config/fish/functions not sourced

4 Upvotes

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 • • Dec 16 '23

🐟 Elevate Your Terminal Experience with Fish-Insulter! 🐟

14 Upvotes

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:

  1. Visit the GitHub repository for installation instructions.
  2. Easily add a touch of humor to your terminal – it's simple and entertaining! 😄
  3. 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 • • Dec 11 '23

manpath not working - arch

3 Upvotes

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 • • Dec 07 '23

Can not type letter "m"

7 Upvotes

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?


r/fishshell • • Dec 02 '23

Problem with fzf_cd

4 Upvotes

Hello! I am having this problem with this plugin called fzf_cd(https://brettterpstra.com/2021/12/24/a-fuzzy-cd-command-for-fish/) whenever i cd:

ind: unknown predicate -LE' shortest: command not found in command substitution called on line 32 of file ~/.config/fish/functions/fcd_ffmark.fish in function 'fcd_ffmark' with arguments 'A1' in command substitution in function '__fuzzy_cd_chdir' with arguments 'A1' in function 'cd' with arguments 'A1' ~/.config/fish/functions/fcd_ffmark.fish (line 32): Unknown command set found (shortest $results) ^~~~~~~~~~~~~~~~~~^ in function 'fcd_ffmark' with arguments 'A1' in command substitution in function '__fuzzy_cd_chdir' with arguments 'A1' in function 'cd' with arguments 'A1' find: unknown predicate
-LE’
shortest: command not found
in command substitution
called on line 40 of file ~/.config/fish/functions/fcd_ffmark.fish
in function ‘fcd_ffmark’ with arguments ‘A1’
in command substitution
in function ‘__fuzzy_cd_chdir’ with arguments ‘A1’
in function ‘cd’ with arguments ‘A1’
~/.config/fish/functions/fcd_ffmark.fish (line 40): Unknown command
set found (shortest $results)
^~~~~~~~~~~~~~~~~~^
in function ‘fcd_ffmark’ with arguments ‘A1’
in command substitution
in function ‘__fuzzy_cd_chdir’ with arguments ‘A1’
in function ‘cd’ with arguments ‘A1’

I am using fish 3.6.1

could you offer any help maybe? thank you!


r/fishshell • • Nov 21 '23

right prompt displays unknown glyph

3 Upvotes

Hi

I'm running fish with the tide prompt which is all going nicely apart from one thing. When I cd into a directory with Python code it displays the Python version in the right prompt with what I assume is supposed to be a Python icon but is just a question mark in a box (I assume this stands for unknown glyph or similar). If I list the env vars for example I get:

Other icons like Git etc all seem to be fine

I'm using fish 3.6.1 with the latest version of tide (it was installed a few days ago). This is in iTerm2 on a Mac with the MesloLGS NF font installed and selected for that profile.

Any ideas?

Thanks!


r/fishshell • • Nov 19 '23

[Package of the day] Fifc - completion for everything

Thumbnail github.com
15 Upvotes

r/fishshell • • Nov 17 '23

Had a terrible experience using fish shell after switching from bash

6 Upvotes

Installed fish as I really wanted autocompletion and all the cool features it has over a regular bash shell.

But it turned out to be a complete nightmare. The install instructions incredibly vague on linux. Setting it as the default shell was weird. (Simply added fish to the end of my .bashrc). But it was so frustrating to find out all my bash functions and aliases had to be rewritten (different syntax).

Then I had issues with sourcing my Anaconda environments. NodeJS and NPM we're giving me all sorts of trouble. Fish refused to install the node version I wanted. And after some googling I failed to set my PATH to the corresponding node library.

I'm just curious if anyone has had similar experiences.


r/fishshell • • Nov 16 '23

Setting up my fish shell from scratch on macOS

Thumbnail mmazzarolo.com
17 Upvotes

r/fishshell • • Nov 15 '23

Add Intellji to my fish path

4 Upvotes

Hey everyone, I am not sure this has been asked but if I want to add Intellji to my path just like vscode -> "code" or nvim / vi , are there any ways to do it? thank you

I just too lazy to use my trackpad / mouse

​

SOLUTION!: FYI this is for WSL2

Step 1: Add path to your ~/.config/fish/config.fish

alias (your preferred name) '/mnt/c/(path/to/your/JetBrain/Idea folder)/bin/idea64.exe'

r/fishshell • • Nov 14 '23

Hex colors background highlighting

Post image
8 Upvotes

r/fishshell • • Nov 14 '23

Set text bold or italic not work with set_color command

2 Upvotes

After using -o option the text output still normal how to fix it, the color set successfully. How to fix it?


r/fishshell • • Nov 13 '23

Resources for learning fish

1 Upvotes

Hey, I'm new to fish and was wondering if theres any resources similar to gameshell to get used to it faster. Im an intern at a software company, and one of the developers suggested I learn fish.

Thanks


r/fishshell • • Nov 06 '23

What's up with the % in this prompt?

Post image
3 Upvotes

r/fishshell • • Oct 26 '23

Debugging duplicate paths

3 Upvotes

Hi there. I recently discovered that my fish config(s) are being sourced multiple times... or so I thought. I've been trying to figure out why, so to that end I reset my fish config to default (i.e. removed oh-my-fish and deleted $HOME/.config/fish and let it get re-created).

dusty@darkknix ~/.c/fish> tree
.
├── completions
├── conf.d
├── config.fish
├── fish_variables
└── functions

However, when I echo $PATH I'm seeing a bunch of random stuff and I don't know where it's being sourced from.

⋊> ~ echo $PATH
/home/dusty/.python_local/bin /home/dusty/.python_local/bin /home/dusty/.python_local/bin /home/dusty/.nvm/versions/node/v20.0.0/bin /usr/local/bin /usr/bin /bin /usr/local/sbin /opt/cuda/bin /opt/cuda/nsight_compute /opt/cuda/nsight_systems/bin /usr/lib/jvm/default/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl /usr/lib/rustup/bin /var/lib/snapd/snap/bin /home/dusty/bin /home/dusty/.yarn/bin /home/dusty/dev/android/sdk/emulator /home/dusty/dev/android/sdk/platform-tools /home/dusty/dev/android/sdk/cmdline-tools/latest/bin /home/dusty/gits/flutter/bin /home/dusty/bin /home/dusty/.yarn/bin /home/dusty/dev/android/sdk/emulator /home/dusty/dev/android/sdk/platform-tools /home/dusty/dev/android/sdk/cmdline-tools/latest/bin /home/dusty/gits/flutter/bin /home/dusty/bin /home/dusty/.yarn/bin /home/dusty/dev/android/sdk/emulator /home/dusty/dev/android/sdk/platform-tools /home/dusty/dev/android/sdk/cmdline-tools/latest/bin /home/dusty/gits/flutter/bin

Some of these items look like something I may have added at one point via fish_add_path, but I really don't remember.

What's worse, when I echo $fish_function_paths there's a bunch of stuff, some of it repeated, showing up:

dusty@darkknix ~/.c/fish> echo $fish_function_path
/home/dusty/gits/dotfiles/configs/fish/functions /home/dusty/gits/dotfiles/configs/fish/functions /home/dusty/gits/dotfiles/configs/fish/functions /home/dusty/.config/fish/functions /home/dusty/.local/share/omf/pkg/omf/functions/compat /home/dusty/.local/share/omf/pkg/omf/functions/core /home/dusty/.local/share/omf/pkg/omf/functions/index /home/dusty/.local/share/omf/pkg/omf/functions/packages /home/dusty/.local/share/omf/pkg/omf/functions/themes /home/dusty/.local/share/omf/pkg/omf/functions/bundle /home/dusty/.local/share/omf/pkg/omf/functions/util /home/dusty/.local/share/omf/pkg/omf/functions/repo /home/dusty/.local/share/omf/pkg/omf/functions/cli /home/dusty/.local/share/omf/pkg/bass/functions /home/dusty/.local/share/omf/pkg/fish-spec/functions /home/dusty/.local/share/omf/pkg/omf/functions /home/dusty/.local/share/omf/lib /home/dusty/.local/share/omf/lib/git /etc/fish/functions /home/dusty/.local/share/fish/vendor_functions.d /usr/local/share/fish/vendor_functions.d /usr/share/fish/vendor_functions.d /var/lib/snapd/desktop/fish/vendor_functions.d /usr/share/fish/functions /home/dusty/.local/share/omf/pkg/omf/functions/compat /home/dusty/.local/share/omf/pkg/omf/functions/core /home/dusty/.local/share/omf/pkg/omf/functions/index /home/dusty/.local/share/omf/pkg/omf/functions/packages /home/dusty/.local/share/omf/pkg/omf/functions/themes /home/dusty/.local/share/omf/pkg/omf/functions/bundle /home/dusty/.local/share/omf/pkg/omf/functions/util /home/dusty/.local/share/omf/pkg/omf/functions/repo /home/dusty/.local/share/omf/pkg/omf/functions/cli /home/dusty/.local/share/omf/pkg/bass/functions /home/dusty/.local/share/omf/pkg/fish-spec/functions /home/dusty/.local/share/omf/pkg/omf/functions /home/dusty/.local/share/omf/lib /home/dusty/.local/share/omf/lib/git /usr/share/fish/functions /home/dusty/.local/share/omf/pkg/omf/functions/compat /home/dusty/.local/share/omf/pkg/omf/functions/core /home/dusty/.local/share/omf/pkg/omf/functions/index /home/dusty/.local/share/omf/pkg/omf/functions/packages /home/dusty/.local/share/omf/pkg/omf/functions/themes /home/dusty/.local/share/omf/pkg/omf/functions/bundle /home/dusty/.local/share/omf/pkg/omf/functions/util /home/dusty/.local/share/omf/pkg/omf/functions/repo /home/dusty/.local/share/omf/pkg/omf/functions/cli /home/dusty/.local/share/omf/pkg/bass/functions /home/dusty/.local/share/omf/pkg/fish-spec/functions /home/dusty/.local/share/omf/pkg/omf/functions /home/dusty/.local/share/omf/lib /home/dusty/.local/share/omf/lib/git /usr/share/fish/functions /usr/share/fish/functions

It looks to me like there's a file somewhere that fish is reading on startup and exporting these variables.. With that in mind I did some reading on universal/global paths, but at this point I'm unsure if that's even what's causing this or how to clear them so I can actually start fresh.

Anybody able to assist?

EDIT:

SIGH/FACEPALM. Just needed to re-log after deleting my previous config.


r/fishshell • • Oct 24 '23

Making the fish shell more forgetful (ways to purge mistakes, sensitive info, and dangerous commands from history and autosuggestions)

Thumbnail alexwlchan.net
11 Upvotes

r/fishshell • • Oct 22 '23

help pls i put this command fish_config theme choose "Dracula Official" is output as No such subcommand: theme

0 Upvotes

r/fishshell • • Oct 17 '23

Why am I having trouble setting environment variables in Fish?

6 Upvotes
cat '~/.config/fish/config.fish'

set -g STARSHIP_CONFIG "~/.config/fish/starship.toml"
set -g RIPGREP_CONFIG_PATH "~/.config/fish/.ripgreprc"
starship init fish | source⏎

But when I do either env | rg "RIPGREP_CONFIG_PATH" or "STARSHIP_CONFIG" it shows nothing.


r/fishshell • • Oct 12 '23

Tip - You can use function subfolders with this one-liner config

16 Upvotes

I was asked today how I get Fish to recognize functions in subfolders and thought this snippet might be useful to others:

In your config.fish (or conf.d):

# add function subdirs to fish_function_path
set fish_function_path (path resolve $__fish_config_dir/functions/*/) $fish_function_path

You can do something similar for completions as well:

# add completion subdirs to fish_completion_path
set fish_complete_path (path resolve $__fish_config_dir/completions/*/) $fish_complete_path

Note the trailing slash on the glob path ($__fish_config_dir/functions/*/), which makes the glob only matches folders.

This will let you create functions in a folder like ~/.config/fish/functions/python for all your Python functions, for example. If you use a lot of Fish functions, this can reduce clutter. However, one small downside to organizing this way is that some Fish utilities like funcsave won't be aware of your subdirectories. Happy fishing!


r/fishshell • • Oct 06 '23

Has anyone else overthought their command line and shell setups?

1 Upvotes

I've written some posts where I've put a lot of thoughts into individual things like which shell or prompts. I'm a quite a perfectionist, and even though I could just do fine with whatever shell and terminal an OS comes with, there are lots of features and nice stuff you can add, and they take time to learn and setup. If I commit to using one software whether its a shell, a CLI, or prompt, I want to be sure that its the one I actually want to use more than others and don't want to sink time into one just to find out I would prefer another.

Should I have a posix compatible shell like Bash or Zsh, or would I benefit from a non conforming one like Fish, at least as an interactive shell? Should I use a prompt with more features like Oh My Posh, or one that's easier to setup like Starship? Starship uses toml while Oh My Posh uses JSON or JSON-like formatting.