Quantcast
Channel: Active questions tagged fish - Stack Overflow
Browsing all 106 articles
Browse latest View live
↧

How do I translate this `for` loop for the fish shell?

I'm translating a script from Z shell to Fish, and I've got this one part I can't figure out how to translate: for (( i=0; i < $COLUMNS; i++ )); do printf $1 doneThe only documentation for for loops...

View Article


Define an alias in fish shell

I would like to define some aliases in fish. Apparently it should be possible to define them in ~/.config/fish/functionsbut they don't get auto loaded when I restart the shell. Any ideas?

View Article


Get previous command in Fish shell

Is there a way to get the previous command (with its parameters) in Fish shell? I.e. not its exit code/status but the actual command given.My use case is that I'd like to know the previous command in a...

View Article

Fish Shell Default PATH

I have a 2023 MacBook Pro that I use to run many python scripts from the terminal using Fish. I use the home-brew python3 installation to avoid messing with my system install, but I am having issues...

View Article

In Fish, how do I check that two paths are the same?

I'm trying to write an if statement that checks to see if two variables refer to the same file or directory. I can't simply compare the strings, because I want two different strings that refer to the...

View Article


conda activate failed in fish

I am using conda 23.7.4 and fish shell on Windows10,I execute conda init fishsuccessfully,but conda activate pytorch failed, and the error report said:usage: conda-script.py [-h] [--no-plugins] [-V]...

View Article

In fish shell, how to set a variable with default fallback?

I'm looking for the equivalent of the following bash syntax, but for the fish shell:local datafile="${_Z_DATA:-$HOME/.z}"i.e define a local variable that will take the value of $_Z_DATA if this one is...

View Article

How to compare integers on fish shell?

There isn't much documentation on fish. I need to know if date '+%k' is greater than 8How do I do it? Thanks.

View Article


In fish shell how to check if a variable is a number?

How to check if a variable is a number in fish shell?Looking for a simple way of doing it.

View Article


How can I generate shell completions? [closed]

I'd like to provide shell completions for all major shells for my program (I consider bash, fish and zsh as major shells, but other ones can be considered).I don't want to write them, I'd like them to...

View Article

Fish Abbreviation to Run Heredocs in Bash

I am trying to write an abbreviation that will do the following:if there is << in the whole buffer somewhere, it will enclose it with bash -c "<the-buffer>"So, If I runtee...

View Article

Error: fish: ${ is not a valid variable in fish [closed]

So I'm trying to run this command to turn files into a .chd file:for i in *.cue; do chdman createcd -i "$i" -o "${i%.*}.chd"; doneBut I get this error:fish: ${ is not a valid variable in fish.for i in...

View Article

How to get the full current command in Fish Shell

I want to build a notification with info about the current command using terminal-notifier but I fail to find the way to get the current command, marked as (????) below.alias notify=terminal-notifier...

View Article


Cannot user fish config env variables with pycharm [duplicate]

I am trying to use my environment variable set inside my ~/.config/fish/config.fish file. When I use echo to display my ENV_VARIABLE, I get the value in the terminal (I set fish to be my default shell...

View Article

How do you dynamically reload fish config files as you would in bash?

I am looking for the equivalent of source .bashrc for Fish.

View Article


Image may be NSFW.
Clik here to view.

ctrl-r search in fish with long commands [closed]

I'm looking for a solution to searching history with fish when your history is full of long commands. I often have curl commands that contain json payloads in my history that I want to repeat, for...

View Article

How to use fish aliases in bash scripts

I have a bash script and I want to use a command in it, that I defined in my config.fish like this:alias setbg='feh --bg-fill'However when I use the command in my bash script, I get:setbg: command not...

View Article


In fish shell, how can I put two conditions in an if statement?

What I want to do using bash:> if true; then echo y; else echo n; fiy> if false; then echo y; else echo n; fin> if false || true; then echo y; else echo n; fiyNow trying with fish:> if...

View Article

Git stash: How to stash tracked files into a single stash via script?

I often do something like git add/checkout/stash -- (find -name "*.extension").For example, to revert all text files or all images.It works fine with add and checkout.When using add, untracked files...

View Article

conda cannont initiate in wsl with fish

I'm trying to install anaconda on wsl with fish.And the result of conda init is this:enter image description hereAnd the result of conda init fish is this:enter image description hereBoth of them come...

View Article
Browsing all 106 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>