Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 16 19:43
    Nonie689 commented #9136
  • Aug 16 19:43
    bagohart starred fish-shell/fish-shell
  • Aug 16 19:43
    bagohart starred fish-shell/fish-shell
  • Aug 16 19:39
    faho commented #9136
  • Aug 16 19:37
    faho commented #9136
  • Aug 16 19:28
    Nonie689 commented #9136
  • Aug 16 19:17
    faho closed #8886
  • Aug 16 19:17
    faho commented #8886
  • Aug 16 19:06
    faho commented #9136
  • Aug 16 18:59
    Nonie689 commented #9136
  • Aug 16 18:57
    bagohart edited #9145
  • Aug 16 18:57
    bagohart edited #9145
  • Aug 16 18:57
    bagohart edited #9145
  • Aug 16 18:56
    bagohart opened #9145
  • Aug 16 18:37
    faho commented #9136
  • Aug 16 18:35
    Nonie689 commented #9136
  • Aug 16 18:32
    faho commented #9136
  • Aug 16 18:19
    faho commented #9136
  • Aug 16 18:18
    faho commented #9136
  • Aug 16 18:05
    Nonie689 commented #9136
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
schuelermine
@schuelermine:matrix.org
[m]
OK
it just seems rather unintuitive is all
Aaron Gyes
@floam
some commands can be fully specified - like our builtins for example.
Peter Ammon
@ridiculousfish
Yeah, it feels backwards, huh. The syntax >file looks like "redirect the stdout stream to a file", but under the hood it's "throw away whatever stream is associated with stdout, and replace it with this file."
Streams don't have descriptors; a descriptor has a stream.
Aaron Gyes
@floam
hm
all streams have a descriptor, fileno() will tell it.
Peter Ammon
@ridiculousfish
By "stream" I don't mean FILE * which is just a libc thing, I mean the underlying kernel resource.
Aaron Gyes
@floam
maybe we could do something to make pipes and redirections more obvious, like highlighting the extent when the cursor is on the operator.
David Adam
@zanchey
ridiculousfish, that's a really interesting conceptualisation, had never occurred to me (but the backwardsness certainly had)
Subsentient
@Subsentient
How open is Fish to additional commands via a PR? In particular, I have some additions to the string subcommand in mind.
David Adam
@zanchey
we'd certainly consider them
if there's a lot of work involved you might want to open an issue to discuss the proposed design
Emily Grace Seville
@EmilySeville7cfg
How to scroll completion descriptions left/right?
David Adam
@zanchey
I don't think you can, you have to resize your window to see more
Emily Grace Seville
@EmilySeville7cfg
My screen sometimes is too small for some descriptions ;)
David Adam
@zanchey
yes, I know what you mean. we were trying to keep them fairly short for most commands but it's not always easy
Thom Chiovoloni
@thomcc
if exit is used in a function, is that the same as return (i assume not but it would be nice, although thinking more i can see many reasons why it shouldn't be)
i guess really what i want is an easy way to "print a message to stderr, and exit return a status to the caller". i find myself writing this often, and because i can't return from the caller (nor would i really want that) i can't really encapsulate it
Thom Chiovoloni
@thomcc
that said a significant portion of why i want this is despite having used fish heavily for years now, i have to look up the syntax for printing to stderr every single time
Fabian Boehm
@faho
@thomcc exit in a function executed inside the shell exits the shell. exit inside a script exits the script.
Basically it jumps to the nearest source.
Thom Chiovoloni
@thomcc
yeah, that does make sense
Aaron Gyes
@floam
@EmilySeville7cfg really, the descriptions are probably just too long; try to summarize them, we'll take the PR.
1 reply
let alone being able to read them in their entirety, it is very useful to make them all short enough to be displayed in 2 or 3 columns in at least a bigger terminal window
like, it literally adds a dimension, mannnn
Aaron Gyes
@floam
the completions must only indicate the functionality such that a familiar user can be reminded or an unfamiliar user somewhat guided; they need not be fully descriptive.
Aaron Gyes
@floam
@thomcc omg, sorry, I think I deleted one of your comments on accident. I was intending to reply.
Anyhow, I suggest make a feature request re: wanting an easier way to stderr a string.
there's even this family of functions in C, at least on BSD: it's not crazy
Thom Chiovoloni
@thomcc
hm
Thom Chiovoloni
@thomcc
fair enough. rust has eprintln too, and if you squint perror and friends are sort of similar. i dont know of other shells with it though. it does feel a little silly to request something like this when it's, like, literally only 3 characters away (even if they're basically impossible to remember)
Aaron Gyes
@floam
well, I did the same thing. When I could redirect all to stderr with ^ I felt more confident. I eventually did memorize them but it took years.
I'd be trying variations of 2&>1 1>2 &2>1 1&>2
that particular syntax just never felt natural.
living rent free in my homedir: some rando files named 1 and 2
Aaron Gyes
@floam
I had to chmod 000 1 & chmod 000 2 to make sure I wasn't fucking it up.
but my memory is weird.
Aaron Gyes
@floam
is it just me or is __fish_complete_suffix broken?