Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 19:37
    francesco-ledda starred fish-shell/fish-shell
  • 18:39
  • 18:13
  • 18:02
    moverest opened #7426
  • 17:54
    Hydranet commented #7425
  • 17:45
    Hydranet commented #7425
  • 17:45
    Hydranet commented #7425
  • 17:45
    Hydranet commented #7425
  • 17:40
    faho commented #7425
  • 17:39
    Hydranet commented #7425
  • 17:37
    Hydranet commented #7425
  • 17:33
    faho labeled #7425
  • 17:32
    faho reopened #7425
  • 17:32
    faho commented #7425
  • 16:49
    Hydranet closed #7425
  • 16:49
    Hydranet commented #7425
  • 16:40
    Hydranet edited #7425
  • 15:12
    Hydranet opened #7425
  • 11:19
    Ravenclaw-OIer commented #7418
  • 11:14
    ollydevulder starred fish-shell/fish-shell
Sly
@SlyBouhafs
It looks like fish is having a syntax issue but i am not sure where that is.
Thom Chiovoloni
@thomcc
it sounds like you have something like set tmp = $(mktemp)
JagWireZ
@JagWireZ
Hello all! I'm looking for a, hopefully, quick answer that I can't seem to find. In a fish script, how to I get the path of the script? I always like to set variables of the directory where the script resides.
JagWireZ
@JagWireZ
Found it: set -l spath (realpath (dirname (status --current-filename)))
Surya Bakshi
@sbaks0820
so i'm trying to understand fish shell functions. I have a function that iterates through a series of images and videos and sorts based on if width > height or height > width. To do this for videos i use ffprobe.
now the problem i'm running into is that on certain videos the ffprobe operation in the function takes a very long time to finish and if i check my disk usage through df a lot f disk space is being eaten up. After the ffprobe for that file completes and the functiuon moves to the next file, the disk usage is back down
on the same file if I run ffprobe manually, it returns instantaneously
so my question is: does this look like a consequence of doing many ffprobe operations with a fish function or is it due to repeated queries to ffprobe (i.e. it's an ffprobe problem)?
i wondered if there's something funky happening with fish, but to be honest i can't explain this behavior
David Adam
@zanchey
the only thing I can think of is if you are piping the output of the function somewhere
Surya Bakshi
@sbaks0820
you know what after all my debugging turns out it isn't even the ffprobe that's slow af
soooooo.... woops
Surya Bakshi
@sbaks0820
but another question how do i make a fish function fail/throw an error on a certain condition?
just exit 1
ridiculousfish
@ridiculousfish
Typically you want to just return an error, like return 1 or return $status.
For example if your function is imgsort you might have imgsort return an error code (anything other than 0) if it fails. Then at the call site: if not imgsort ... and then you can handle the error.
Lorenzo Gabriele
@lolgab

Hi everyone :)
I'm asking something very basic but I couldn't find it in the documentation:
How can I pass a list from a subcommand to the parent command?

> kill -9 (pidof java)
kill: illegal process id: 46560 46625

Because it is passed as a single argument and not as a list of arguments..

David Adam
@zanchey
yeah it's not expanded into two words. try ... (pidof java | string split " ")
Fabian Homborg
@faho
Or better yet pkill java
@lolgab that is
Lorenzo Gabriele
@lolgab
Thank you very much @zanchey and @faho .. Yes I use even killall but this was just an example to learn how to pass list of arguments to commands :)
John Meow
@j0hnmeow
How can I automatically add some are all commands from a sourced script to my history? So I can e.g. press arrow up and execute the last command from the script again
Fabian Homborg
@faho
@j0hnmeow Commands from scripts are never entered into history, so... you don'.
Imagine if that happened, you'd scroll history up and get a ton of commandsyyou never knowingly entered
John Meow
@j0hnmeow
Then how do I explicitly add it?
$history seems to be readonly
Fabian Homborg
@faho
@lolgab The difference to bash here is that fish only splits command substitutions on newlines,while bash by default splits on newlines, spaces and tabs.
This is better in most cases, the notable exception being pkg-config. Tbh any tool that expects its output to be split on spaces is weird, and splitting on spaces is responsibleffor an approximate 90% of bash script bugs
@j0hnmeow You don't.
If you want a command to appear in history, you'll have to execute it in the commandline.
Inserting into history is #4506
John Meow
@j0hnmeow
Ok ty
This message was deleted
Subscribed
haneatic
@haneatic
Hi guys, I installed nvm and it works fine in my fish shell. If I use IntelliJ to open the terminal nvm is still installed but all global dependencies like npm or yarn are no longer defined. Anyone got an idea why?
Fabian Homborg
@faho
@haneatic Check $PATH in both, Intellij's terminal does awful things to fish's configuration (yes, bugs are open)
haneatic
@haneatic
@faho thanks for your explanation. Yeah the $PATH var is indeed different. However, both have nvm defined and nothing more regarding npm/yarn so it's actually surprising that it works in the classic terminal as well lol
is there any solution to this?
Fabian Homborg
@faho
@haneatic Check type npm in both
Again, the real fix is in IntelliJ - they override config.fish, breaking a bunch of stuff. So I can't really recommend using that terminal at the moment.
haneatic
@haneatic
ah I see
understandable
what a bummer
matrixbot
@matrixbot
Nate Sturtz hello
marcusatiliusregulus
@marcusatiliusregulus
this emoji interferes with my fish_prompt: 🏜️ (https://emojipedia.org/desert/)
after i paste it into the terminal all sorts of weird things happen: if i hit backspace i can delete into the prompt, in vi-mode hitting esc-capital-i (normal-mode and insert at the beginning) starts pushing the command backwards into the prompt.
does this happen to anyone else or am i doing something wrong (i customized my prompt)?
fish version 3.1.2, alacritty a6681e3a
Patricio Palladino
@alcuadrado
Is there a way to provide tab completions though a program? Let's say that I wrote my-command <TAB>. Can I instruct fish to run a program that returns the possible completions for my-command?
Patricio Palladino
@alcuadrado
ok, got it
I didn't realize that -a evaluated its argument every time
Andrew Cassidy
@drewcassidy
@marcusatiliusregulus oh neat, I can reproduce that on linux (via mosh) but not in macOS. I think its having trouble with the U+FE0F variant character
marcusatiliusregulus
@marcusatiliusregulus
ah, good to know im not the only one seeing this.