Questions tagged [fish]

The fish shell is an alternate shell, and scripting language, for *nix systems (including macOS). Its claim to fame is being an intuitive, user friendly, and efficient modern shell. Some key examples, per their own website, are enhanced syntax highlighting, completions and autosuggestions (automatically generated from man pages), high performance, and sane scripting.

Fish is a command-line shell designed to be both smart and user-friendly, with auto-suggestions, fully 256 color support, and web-based configuration. Packages for Fish exist for macOS and various flavors of Unix.

Features that differentiate it include rich syntax coloring, auto-completion of commands and arguments, and a high-performance, multithreaded implementation.

Resources

991 questions
0
votes
1 answer

Fish looping weird behaviour

I have this loop at config.fish: set W_COLS (tput cols) for x in (seq $W_COLS) echo $x end This works great, iterating trought my terminal's width. I get and output of: 1 2 3 . . . 80 I'd like to print the number side by side, without a new…
jviotti
  • 17,881
  • 26
  • 89
  • 148
0
votes
1 answer

How can I use sed to output the current and previous directory while including a tilde if $HOME is one directory further?

Currently my zsh prompt utilizes $'%2~ %%' to output the current and previous directory before just displaying % as my input prompt. For example, if I'm in /Users/david/Documents/Code/project, my prompt will display: Code/project % However, if I…
davidcelis
  • 3,277
  • 1
  • 19
  • 16
0
votes
1 answer

Fish $EDITOR interaction

How can I launch the currently configured editor from the fish shell? That is the editor associated with $EDITOR. What would a function look like that takes input from the pipeline and opens it in the editor identified by $EDITOR. What would a…
Eric Schoonover
  • 47,184
  • 49
  • 157
  • 202
0
votes
1 answer

fish runs some functions in .config/fish/config.fish while sourcing

I'm trying the fish shell, and it seems to run some functions I've defined in it's config file when I open a new fish tab. For example, if I have this function: function foo cd ~/ end fish will go into an infinite loop as it constantly cd's into my…
Vlad the Impala
  • 15,572
  • 16
  • 81
  • 124
-1
votes
1 answer

View Tmux Status In Prompt

I have a fish prompt like bellow: function fish_prompt if set -q TMUX set -l tmux_prompt (tmux display-message -p '(#{client_session}(#{session_windows})#{window_index}-#{window_name})') set -l prompt $(set_color…
Ahmad Ismail
  • 11,636
  • 6
  • 52
  • 87
-1
votes
1 answer

how to move ssh-key related files to another directory?

i've been trying to clean up my root directory so that it isn't clustered with random dotfiles. nonetheless, on setting up the ssh-key i came to a dead-end, where i wouldn't find a way to migrate known_hosts file to the other direction…
Lanny
  • 1
  • 1
-1
votes
1 answer

Putting Python between terminal and shell

My OS is Linux. I use FISH shell with Alacritty terminal emulator. I want to write a Python code which splits the terminal in two, separating them with "|" characters, and having user be prompted on both sides. Kind of like how Tilix does it, I want…
Voil
  • 3
  • 3
-1
votes
1 answer

Show the documentation for the current commandline parameters

When using fish I often struggle where I hit tab to open up the command line completion. But then when I type the first letter of the completion the menu closes. Can I keep it open and have it select / reduce the options so that I don't need to…
Anemoia
  • 7,928
  • 7
  • 46
  • 71
-1
votes
1 answer

Getting the value of a variable from another script in fish shell

I have two scripts in the same directory: latlong.sh #!/bin/sh set latlong 'x.xxxxxx:x.xxxxxx' autostart_once.sh #!/bin/sh . ./latlong.sh # some start up commands redshift-gtk -l $latlong -t 6500:3600 & However, running autostart_once.sh above…
SunnyMonster
  • 500
  • 5
  • 14
-1
votes
1 answer

How to convert $argv in to a single string in the fish shell

I am writing a fish function to play the first result of a search term as audio using yt-dlp and mpv. The problem is that I need the search term as a single string, whereas $argv is an array of strings. How do I convert an array of strings to a…
berinaniesh
  • 198
  • 13
-1
votes
1 answer

Can't run nvm of Fish shell on Mac

I have installed Fish shell via Brew. According to the instructions given on the terminal while installing Fish, I added: export NVM_DIR="$HOME/.nvm" [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm …
Pikk
  • 2,343
  • 6
  • 25
  • 41
-1
votes
1 answer

In fish true == 0, but false != 1?

In fish, true seems to equal 0: ❯ if true == 0; echo "YES"; else; echo "NO"; end YES But false seems to not equal 1: ❯ if false == 1; echo "YES"; else; echo "NO"; end NO In bash both of them are not equivalent to their numeric value: $ if [ true…
robertspierre
  • 3,218
  • 2
  • 31
  • 46
-1
votes
1 answer

Fish weird endline character at end / Fish shell outputs ⏎

I have a Python script that prints some numbers, like this: results = [42, 21, 64, 32, 16, 8, 4, 2] for number in results: print(number, end=' ') In the console, the output of this script is: 42 21 64 32 16 8 4 2 ⏎ Why is there a weird…
Rahil Prakash
  • 11
  • 1
  • 5
-1
votes
1 answer

Change LSCOLORS using fish on macOS

I'm trying to set the colour of dirs in Terminal on the latest version of macOS (12.5) with an M1 using fish. I've tried both the suggested commands: set LSCOLORS XXXX and set -Ux LSCOLORS XXXX with XXXX being the desired colour e.g. G or…
-1
votes
1 answer

fish shell,The behavior of the test command does not work

I wrote the following file, but It does not work as expected. I have set up the test command to run if the file does not exist by using a combination of the test command option and not... function touch /usr/bin/touch $argv set -l ext (echo…