Questions tagged [fish]
Fish is a unix shell with a clean design and a limited but powerful feature set.
225
questions
2
votes
1
answer
239
views
MacOS/iTerm2/fish arrow keys stops working after terminating a process with ctrl+c
I am using iTerm2 on my mac pro, and using fish as my shell. Every time I have a process running and I break it by pressing ctrl+c, the arrow keys stops working after and starts emitting ^[[A etc.
...
2
votes
2
answers
621
views
How do I add multiple fish functions in a single script?
I'm trying to shift to fish from zsh. As I've seen, load time of fish increases if I use alias. So I'd like to convert all of my alias into functions, but the thing is creating a function script for ...
1
vote
2
answers
374
views
How to display stdout of command in `less` with as few keystrokes as possible?
I often find myself piping a command's output into less because less is far superior for studying the output than the normal terminal.
While I can always append | less to every command, I was ...
1
vote
2
answers
344
views
How to enable auto logout in fish shell?
A quick google search says I could enable auto logout (for text consoles) by setting a TMOUT parameter. However, I discovered later that this would only work with the bash shell.
Is there a way I ...
2
votes
1
answer
117
views
Fish - remove file before download
I run fish shell and it gives an exception when I try to remove a file which is not found. I have the following script:
#!/usr/bin/fish
set files "/tmp/*.xlsx"
rm -f "$files"
...
1
vote
1
answer
190
views
fish - Run multiple abbreviations with another abbreviation
I have a few abbreviations that I want to run on one command.
Let's say given this config:
abbr command1 "echo 1"
abbr command2 "echo 2"
abbr command3 "echo 3"
I want ...
-1
votes
1
answer
242
views
Having an interactive shell experience but running everything through dash
So i'm starting to get addicted to POSIX standards and simplicity yet i hate not having autocomplete using the arrows to go through characters and i want a cool shell prompt.
so is there anyway that i ...
1
vote
1
answer
170
views
Fish completion script
I'm working on a completion script for a command, and I'm stuck. The docs and various websites I find don't fit what I need. The main command is pacstall and it has the flags: -I -S -R -C -U -V -L -Up ...
2
votes
2
answers
328
views
How to preserve formatting in fish shell command substitution output stored in the var?
I'm already scratching my head for a while because of this:
> cat file
line1
line2
> set tst (cat file)
> echo "$tst"
line1 line2
> set tst "(cat file)"
> echo &...
0
votes
2
answers
1k
views
Environment variables in Fish
I need to use a program called Kpax, the "installation" process consist in this:
(for bash users, edit ~/.bashrc)
export KPAX_ROOT=/home/dritchie/kpax <- substitute the proper ...
-2
votes
1
answer
191
views
Difference between the shells [closed]
I've been using Linux Mint since March 2020, and I haven't used any shells other than the Bash shell.
So what exactly is the difference between the Bash shell and the other shells (Fish, Zsh, Ksh, ...
1
vote
0
answers
75
views
Make any program "think" its output is a terminal (ie stop it from "knowing" its output is a pipe/file/substitution/etc) to keep ansi-color-codes etc [duplicate]
EDIT:
specifically what worked for me was using the python script in this answer
and I gave the tweaks I used to get it working for my autoloading functions in fishshell, and on ubuntu 20.04, in this ...
0
votes
0
answers
312
views
How to make --exclude-glob work with this use case of lftp and fish shell?
I have a statement that looks like this:
set cmd 'set ssl:verify-certificate false;
open -u abc,def ftp.somewhere.com;
mirror --only-newer --exclude-glob "{.git|node_modules|wp-config.php}" \...
1
vote
1
answer
924
views
xfce terminal ignores set default shell
I changed the default shell with
chsh -s `which fish`
but my terminal still launches with bash. If I run chsh again, it says chsh: Shell not changed. I'm using Manjaro x86_64 20.2.1 with XFCE (4.16). ...
1
vote
1
answer
589
views
What is the purpose of (and possibly the convention of using) multiple locations for user configuration in fish shell
I have recently moved to fish from bash. I'm immediately in love with the out-of-the-box functionality, but I'm a little bit at a loss when it comes to configuring the shell.
I've read through the ...
1
vote
1
answer
266
views
How to use hjkl to navigate menu select in fish shell
I can't seem to find any information on how to navigate tab completion or how to bind keys in tab completion in fish shell.
This is what I am trying to achieve but in fish shell rather than zsh. Fish-...
0
votes
2
answers
653
views
How to change shell without the command line
Something broke my fish and I have no idea how to fix it so is there a way to change shell to zsh without using the command line
2
votes
0
answers
182
views
Memory usage out-of-control with shell command, but not with shell script
[Linux Mint 20.1, 16GB RAM, 16GB swap]
I recently converted my system - root and backup partitions - to BTRFS. I've been experimenting with archiving some of root's snapshots to my backup drive, but ...
1
vote
0
answers
98
views
urxvt writing over itself and leaving colored spaces
URXVT is writing over itself and leaving behind colored spaces... I feel like this is easier shown than described:
This started occurring overnight without making any changes, so I'm not sure where ...
3
votes
1
answer
294
views
How to write a command to history in fish shell?
In the zsh shell, I can write something into the command line history like so:
#!/bin/zsh
cmd="cd /special/dir"
print -s $cmd" # save command in history for reuse
How may I do ...
2
votes
0
answers
330
views
Ranger image preview not working in URXVT running Fish shell until I open an image in Feh
I recently started using the Fish shell, and after opening a new URXVT instance I cannot get image previews in Ranger until I open an image first (using feh, in my case). Once an image has been opened ...
1
vote
1
answer
2k
views
Error in terminal emulator: Alacritty
I installed Garuda Linux today. The default shell emulator is Alacritty and the default shell, fish. However, after the update to the system, its constantly giving a warning:
Config error: shell: data ...
2
votes
2
answers
216
views
Is it possible to disable the & ampersand character in fish shell? (make escaping with \& unnecessary)
So it is possible to permanently disable the functionality of ?, making \? unnecessary, by enabling the qmark-noglob feature flag.
I would like to do the same thing for &, as I never use it for ...
-1
votes
1
answer
248
views
How to set environmental variables in Fish?
Guys I recently switched to fish from Bash and I've run into problems setting some specific variables for golang in fish.
In my bashrc I would set them using:
export PATH="$PATH:$(go env GOPATH)/...
1
vote
1
answer
4k
views
Fish: The file is not executable by this user
I made fish function in ~/.config/fish/functions/confgit.fish:
function confgit
/home/john/Projects/confgit $argv
end
But when I run this function it just says:
fish: The file “/home/john/...
6
votes
1
answer
601
views
xargs | Use input as command
I would have assumed that following examples work perfectly fine.
$ which -a python python3 pip | xargs -I {} {} --version
No '{}' such file or folder
$ which -a python python3 pip | xargs -I _ _ --...
1
vote
2
answers
280
views
test standard output with fish
I have a script that prints a string to terminal,
and I want to check value of myScript output.(in this case resultString)
I tried with this method, but it didn't worked.
(for simplicty i replaced my ...
1
vote
1
answer
116
views
Resume n jobs to background concurrently
I have many paused jobs in my shell. I would like to run bg for all of the jobs with a maximum four jobs running concurrently.
I know I can use GNU parallel for new tasks but I would like a BASH or ...
0
votes
2
answers
678
views
run for loop with bash command in fish shell
I'm trying to run a simple command on my fish shell, but I am not able to execute. It just keeps adding lines for me to add additional data to, not sure on how to execute accordingly.
$ for acc in `...
1
vote
1
answer
2k
views
How to fix Error: Whenever I type something in terminal there is an error
I use fish as my login terminal. I was trying to run android simulator. I already edited my bash profile so I switched to bash by typing bash. I restarted my terminal after I logged off my computer ...
4
votes
1
answer
2k
views
Bash's Process Substitution "<(command)" equivalent in fish shell
In bash, I usually do grep -f <(command) ... (I pick grep just for example) to mimic a file input.
What is the equivalent in fish shell? I cannot find it in the documentation.
0
votes
1
answer
197
views
How to lock my session as soon as I login?
I'm on Manjaro Gnome (using fish) and I want to enable Automatic Login and then force the session to lock. The idea being that I can boot and walk away from my computer, knowing that it will continue ...
2
votes
1
answer
505
views
How can I get numbers in fish history
I'm using fish shell but the history command in this returns something like
ls
cd Downloads
ls
mkdir new_folder
whereas, the same thing in zsh would return
399 ls
400 cd Downloads
401 ls
402 mkdir ...
1
vote
2
answers
667
views
Get count of occurrences of each word in document
How can I find count of every word in a file?
I want a histogram of each word in text pipe or document. New line and empty lines will exist in document. I stripped everything except for [a-zA-Z].
> ...
3
votes
1
answer
2k
views
fish shell : capture multi-line output to a variable with piping or read
if you
curl https://www.toptal.com/developers/gitignore/api/python
you see the file as expected, with newlines. But if I
set response (curl https://www.toptal.com/developers/gitignore/api/python)
...
1
vote
1
answer
22
views
fish alternatives for [[ pattern tests ]]
Trying fish, I am stuck on some bash conditionals using [[ ... ]].
It looks like [ ... ] is the usual thing, but I'm stuck on pattern and regular expression tests:
[[ "$PATH" =~ "$1&...
1
vote
1
answer
347
views
fish equivalent of ${this:-that} expansion and similar
Trying fish, I am stuck on equivalents for some of the variable expansions from bash:
x=${this:-$that}
x=${this:-that}
How do I do that in fish?
6
votes
1
answer
1k
views
kill %1 equivalent in fish
In bash, if I run kill %1, it kills a backgrounded command in the current shell (the most recent one, I believe).
Is there an equivalent of this in fish? I haven't been able to find it online in a bit ...
1
vote
0
answers
436
views
Set permanent environment variable for all shells
I want to set the root level environment variable that comes from sh(1) so that it is shared across all shells: sh, bash, zsh, and fish.
I can see in /etc/profile there's a command /usr/libexec/...
1
vote
2
answers
2k
views
Error starting the fish_config web ui in WSL
I want to customize my fish shell using the Web UI mode, but when running fish_config colors, the following error is shown.
surface@Surface ~> fish_config starting-colors
Web config started at file:...
3
votes
2
answers
2k
views
check if variable is null in fish
I want to check a condition if a variable is null in fish(friendly interactive shell).
if test "$argv" = null
# do something...
else
# do something else...
0
votes
2
answers
416
views
Stop fish complaining: fish: $? is not the exit status. In fish, please use $status
I am building a script that should work in csh, bash, and fish with no change:
This does the right thing in all the shells,
perl -e '$bash=shift;$csh=shift;for(@ARGV){unlink;rmdir;}if($bash=~s/h//){...
3
votes
1
answer
709
views
How to put the time string into the fish shell's prompt?
Currently I use this theme for fish, installed using fisher.
This is how it shows up now:
I would like the time string (e.g. 19:19) to be shown before the /m or after react or after the part with ...
3
votes
1
answer
390
views
Terminal fish prompt blank
So I'm trying to change my fish shell terminal prompt but every time I change anything too complicated (beyond colour changes and rearranging the prompt), it just turns up blank.
I'm running Arch ...
4
votes
1
answer
3k
views
How can I make xfce4-terminal start fish shell?
I want to use FISH shell. But I've read FISH is not a POSIX shell so setting it to default shell by chsh is not recommended. What I want is whenever I start xfce4-terminal I would like to start FISH ...
0
votes
3
answers
2k
views
TMUX and terminal colors are not the same locally and over ssh
I have a bunch of dotfiles that allow me to have a pretty theme on my terminal and tmux on my local host. I use kitty, fish and tmux. To properly define colors and have a global coherence, I use the ...
3
votes
1
answer
456
views
Enabling fish-style manpage-based completion in bash
One of the really appealing features of fish is that it supports intelligent tab completion of options based on their specifications in each command's respective manpage. Has anyone created a way to ...
0
votes
0
answers
113
views
Fish shell error
When I type command in fish shell, after command it returns: Could not send own process 401, 'sed' in job 3, 'commandline | sed 's|\s\+|\x1e|g'' from group 400 to group 400 setpgid: unknown error (...
2
votes
1
answer
210
views
fish equivalent for sequence of commands -- { cmd1 ; cmd2; }
In bash, you can pipe the same output to two commands using {}, i.e. in the following:
cmd0 | { cmd1 ; cmd2 ;} | cmd3
cmd1 and cmd2 get the output of cmd0 in their stdin, and cmd3 gets the output of ...
2
votes
1
answer
488
views
Fish shell, disable pager navigation through Tab / Shift Tab
Fish is a great shell (the best?) but its completion interface has a particular quirk that I personally don't like and would like to disable. It's expressed by this sentence in the tutorial:
Hit ...