Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 28 23:11

    ridiculousfish on master

    Fix the flaky tty_ownership tes… (compare)

  • Nov 28 22:35
    Alexei95 starred fish-shell/fish-shell
  • Nov 28 22:07
    EmilySeville7cfg opened #9395
  • Nov 28 22:02
    EmilySeville7cfg synchronize #9391
  • Nov 28 20:09
    Song252900 starred fish-shell/fish-shell
  • Nov 28 20:00
    faho commented #9370
  • Nov 28 19:53
    faho commented #9370
  • Nov 28 19:52
    faho commented #9370
  • Nov 28 19:36
    floam commented #9370
  • Nov 28 19:36
    floam commented #9370
  • Nov 28 19:22
    faho commented #9370
  • Nov 28 19:22
    faho commented #9370
  • Nov 28 19:21
    faho commented #9370
  • Nov 28 19:08
    floam commented #9370
  • Nov 28 18:03
    github-actions[bot] locked #8467
  • Nov 28 18:03
    github-actions[bot] locked #8430
  • Nov 28 18:03
    github-actions[bot] locked #8476
  • Nov 28 18:03
    github-actions[bot] locked #8494
  • Nov 28 18:03
    github-actions[bot] locked #8433
  • Nov 28 18:03
    github-actions[bot] locked #8479
Amos Bird
@amosbird
Hello! How can I kill all background jobs in fish?
It seems kill (jobs -p) does the job
Emily Grace Seville
@EmilySeville7cfg

What about to introduce any environment variable to control what completions are allowed to do and what not? For instance when this variable ($fish_disable_smart_complete or another name) is not set nothing changes (for backward compatibility) and otherwise:

  • --condition complete option is not allowed because potentially it can run for a long time
  • command substitutions are not allowed in --arguments for the same reason

What do you think about it?

Fabian Boehm
@faho
@EmilySeville7cfg There's no real need for it and it's rather complicated. If completions are too slow, make them faster. We try not to introduce configuration options.
This would also be a global option for all completions, which would break completions that are fast enough just because some others aren't.
expandingman
@expandingman:matrix.org
[m]
hello all... I'm finding it surprisingly difficult to run a detached process and save the PID... I'm trying to do something like eval $cmd &; echo $last_pid but this really, really does not seem to want to work...
Fabian Boehm
@faho
@expandingman:matrix.org Fish can't background functions and builtins, this includes eval.
expandingman
@expandingman:matrix.org
[m]

that wasn't my issue, actually I figured it out: the command I was trying to run was all in one string, I needed to string split it an additional time.

Unfortumately this didn't solve what seems to be a much deeper problem of Xorg absolutely not wanting to do what I'm trying to do here lol

having to use the

set cmd (echo original command here)
$cmd &

pattern is a little awkward, but it works

andrewsh
@andrewsh:matrix.org
[m]
I noticed the new fish breaks compat with mc, is it just me or has someone else seen that?
Fabian Boehm
@faho
@andrewsh:matrix.org It's an mc bug - it tries to extract the first line of the prompt and is overly simplistic in doing so. https://midnight-commander.org/ticket/4258
andrewsh
@andrewsh:matrix.org
[m]
wow, 5 months and no fix?
Fabian Boehm
@faho
You'll have to talk to the mc people about that.
Fabian Boehm
@faho
Sometimes bugs happen, and sometimes nobody gets around to fixing them for a while, especially in a volunteer-driven project.
The only sure way to get a bug fixed now is to do it yourself.
andrewsh
@andrewsh:matrix.org
[m]
yeah, I guess
I have for now downgraded fish back to the version where it works
andrewsh
@andrewsh:matrix.org
[m]
anyway, added the details to the Debian bug report, hopefully the maintainer can have a look and figure something out
@faho: thanks!
Patrick
@PatrickF1
Why do these both output the same thing? According to my understanding of character escapes in single quotes, the \$ should result in no regex backreferencing happening
$ string replace -r '(\w+)\s+(\w+)' '$2 $1 $$' 'left right'
right left $
$ string replace -r '(\w+)\s+(\w+)' '\$2 \$1 $$' 'left right'
right left $
Fabian Boehm
@faho
@PatrickF1 #5474 - unfortunately string replace has a superfluous round of unescaping in the replacement part so you'll have to double up the slashes one more time. There's no great way of fixing it so we've introduced a feature flag until we figure out how to detect it and warn about it.
Patrick
@PatrickF1
Hi @faho , thanks for your reply. Why does string replace do a superfluous round of unescaping for the replacement part?
btw https://fishshell.com/docs/current/language.html#future-feature-flags says "round of escaping", but that should read "round of unescaping right"?
Fabian Boehm
@faho
Please read the linked issue. It was simply a mistake in the original implementation.
"un"escaping is a pretty technical term, it's when you turn $ into "expand this" and \$ into $. If it does too much unescaping that means you need more escaping. I do not believe this subtlety helps any in the explanation, so we've left it as "escaping".
Peter Ammon
@ridiculousfish
fish shell is on the orange site once again, lots of nice comments about it
David Adam
@zanchey
some nice comments on HN re: fish today
Jim Richardson
@weaselkeeper
tried fish today as result of reading about it in
HN
had avoided it for a while due to non-posix
hard to step out of decades of relying on posix shells...
Johannes Altmanninger
@krobelus
@weaselkeeper it's POSIX enough for lots of interactive scenarios
Jim Richardson
@weaselkeeper
yeah, focusing on it as an interactive shell, probably stick with bash/sh for scripting, but I do more and more of that in python these days than shell anyway.
If it's going to take more than a few lines/functions, it's getting done in python or a DSL instead of bash
Juan Patten
@jrpat
brand new fish user here. I want to check if a tmux session is running, without outputting anything to the shell. in bash, I do [ -n "$(tmux ls | grep foo)" ] && ... - In fish, the way seems to be set x (tmux ls | grep foo) ; if test $status -eq 0 ...
is there a better way?
Fabian Boehm
@faho

@jrpat If you're just interested in the exit status, simply put the command into the if-condition:

if tmux ls | grep foo

to ignore the output you'd usually redirect it to /dev/null (with the old >/dev/null), but in this case grep has a -q switch:

if tmux ls | grep -q foo

If you also want the output, you can still use the set:

if set x (tmux ls | grep foo)

set doesn't set the status itself and simply passes on whatever the command substitution returned.

Juan Patten
@jrpat
ah ok - very helpful. yeah it's nice that grep has a -q, but I also wondered about the general case when a command doesn't have a quiet flag. >/dev/null it is. thanks!
Subsentient
@Subsentient
Is there a good way to get the index of a particular occurence of a pattern in a string? Like Python's 'derp'.find('e')
Peter Ammon
@ridiculousfish
@Subsentient try e.g. string match --index --regex foo bigfoot, it will show the range of the regex match.
schuelermine
@schuelermine:matrix.org
[m]
Is it fish-specific or a general cross-shell convention that redirections are processed right-to-left?
i.e. cmd 2>&1 >file doesn’t redirect stderr to file, but cmd >file 2>&1 does
David Adam
@zanchey
hmm, the notifiers test seems a bit flaky
Peter Ammon
@ridiculousfish
@schuelermine:matrix.org redirections are processed left to right. 2>&1 means "stdout is dup'd to stderr" and >file means "file is dup'd to stdout". So in 2>&1 >file you end up with stderr as the original stdout, and stdout as the file.
2 replies
Aaron Gyes
@floam
I agree, and do miss --authoritiative; but I wish it were a bit easier to specify flags that can be used only n times and/or only with certain other options.
Peter Ammon
@ridiculousfish
All shells process redirections left to right AFAIK. The only divergent case is mixing a stdout redirection with a pipe.
Aaron Gyes
@floam
the conditionals I used in my few minutes ago completion commit kinda stink.
Peter Ammon
@ridiculousfish
Generating completions is an inherently messy process. I sometimes complete and intend to go back and fix up the command line later. Plus we have so much pain dealing with divergent implementations of utilities already, now imagine trying to encode all the divergent DSLs on top of that...yuck.
schuelermine
@schuelermine:matrix.org
[m]
Oh, I guess I mis-wrote