fish

Fish needs a lazy evulation to remove an element from a list

Fish needs a lazy evulation to remove an element from a list I’m running Fish version 3.7.0, and I want to write a function to remove elements from lists, based on their index. For instance, I want to remove the element from PATH environment variable at index 2: set -l variable_name PATH set -l index …

Total answers: 1

Fish access non-aliased command from alias

Fish access non-aliased command from alias How can I access the non-aliased version of a command from within the alias for that command? In bash, I can do something like alias ls=’ls -l’ to access the non-aliased ls inside this alias for ls. How can I do this in fish? Right now I’m using env …

Total answers: 1

FISH CLI What do the error numbers at the prompt mean?

FISH CLI What do the error numbers at the prompt mean? I am just trying out the FISH – (the FriendlyInteractiveSHell) – CLI & whenever I type in an erroneous Command, a new Prompt appears under the faulty Command prompt with a number in square brackets. I have searched through FISH’s FAQs etc., but no …

Total answers: 1

Error in fish script turns on bracketed paste mode for ssh session?

Error in fish script turns on bracketed paste mode for ssh session? When using a small fish function I’ve cobbled together (not a developer here, so please be gentle … ) for accessing a number of regularly needed ssh hosts, I’m seeing a strange effect: The bracket paste mode get’s activated for the ssh session. …

Total answers: 1

Copy files with different extensions to different basename with same extensions

Copy files with different extensions to different basename with same extensions I have 3 files Original.js Original.vue Original.css How can I easily copy them to Copy.js Copy.vue Copy.css Until now, i always just copied one by one, but if I could use something like copy Original.* Copy.*, that would be awesome. I use the fish …

Total answers: 1

Unable to run git commands before shutdown

Unable to run git commands before shutdown I would like to use systemd to accomplish this if possible. This is what I have done so far. Wrote a script in fish that will stage, commit and push files to a repository. Script made executable with chmod u+x <script>.fish. Wrote a service unit. Reloaded with systemctl …

Total answers: 1

How can I delete non-mp3 files recursively using fish shell? [SOLVED]

How can I delete non-mp3 files recursively using fish shell? The tree list is like this: /Music |— folder1 |— folder2 |— folder3 | |—- folder3.1 | |—- folder3.2 | —- folder3.3 |— folder4 I had tried the command rm | ls -R | grep -v "*.mp3" Asked By: Leo_2233 || Source You can use …

Total answers: 1

How to run a command n times in the fish shell?

How to run a command n times in the fish shell? The fish documentation gives the following way to run a for loop. for i in 1 2 3 4 5; echo $i end Let us say I want to run a command 1000 times, How can I do it? Asked By: berinaniesh || Source …

Total answers: 2

Complete a positional argument only once

Complete a positional argument only once I’m trying to write a completion for a command (call it gs) that takes an SSH hostname as its first argument, and an arbitrary string as the second argument. I’ve stolen this from the default SSH completion: # Load completions shared by various ssh tools like ssh, scp and …

Total answers: 1

How can I name my log files according to the date?

How can I name my log files according to the date? I have tried to do something like date=date and then name my file $date.txt but the output was date.txt. Fun thing, I asked Copilot to help but I don’t understand its advice and unsure how to fix it: Crontab # run the main script …

Total answers: 2

Fish shell – what's wrong with this syntax?

Fish shell – what's wrong with this syntax? I have a bash script which cats a heredoc string, and I’m running it inside a fish shell and then piping it to a source call, like so: ~/foo/baz: 1 #!/usr/bin/env bash 2 3 cat << EOS 4 function bar 5 echo ‘Hello world’ 6 end 7 …

Total answers: 1

Fish shell: How to disable help message?

Fish shell: How to disable help message? When I start fish, it prints: Welcome to fish, the friendly interactive shell Type `help` for instructions on how to use fish And then the prompt. I’ve actually used fish for a while so I don’t need this welcome message. How can I disable it? Asked By: Dommondke …

Total answers: 2

Exit 'history' in fish

Exit 'history' in fish I recently switched from bash to fish. I like it, but I don’t know how to exit, when I enter history. How do I do that? Asked By: attendeapril || Source The history command in the fish shell displays your command line history. It does this in a pager, possibly less …

Total answers: 2

Use Git Version of mv/rm etc When in Repository

Use Git Version of mv/rm etc When in Repository Git has its own versions of commands such as mv and rm that we really ought to use when doing these operations inside repositories. However, I’m sure I’m not the only person who often forgets to do this. Is there any way to automatically use these …

Total answers: 2

Fish Completions – How to prevent file completions?

Fish Completions – How to prevent file completions? I am trying to write some completions for an in-house tool. We’ll call it thetool. Lots of the commands to thetool do not take a ‘file’ as an argument. I thought that –no-files and/or –exclusive would do this for me but I don’t seem to be able …

Total answers: 1

When pressing tab, how can I make fish complete to directory/ instead of directory/prefix?

When pressing tab, how can I make fish complete to directory/ instead of directory/prefix? I’m using fish shell. Let’s say that I have a directory named books, containing files title-1, title-2 and title-3: $ tree books books/ ├── title-1 ├── title-2 └── title-3 0 directories, 3 files If I type git add boo and press …

Total answers: 1

Fish shell reports "math: Error: Missing operator" on tab completion

Fish shell reports "math: Error: Missing operator" on tab completion I noticed the error this morning, but I don’t think I have changed anything last night, so I am very confused right now. Perhaps I updated some utilities on my system and it somehow broke the back compatibility. Basically I got a math: Error: Missing …

Total answers: 2

fish shell: universal variables and alias not shared between "contexts"

fish shell: universal variables and alias not shared between "contexts" I use fish shell mainly from Rider IDE and iTerm2. I’ve noticed that every task that implies saving something for future sessions will not operate transparently between the two aforementioned contexts. More precisely if I define a universal exported variable, or an alias, they’ll be …

Total answers: 1