News for hackers. Stuff that matters.
Re:New Features in the Fish Shell by duckerude on Tuesday September 29, 2020 @03:34PM (#24631962)
> Or error messages which return translated commands?

Fish does this in some cases:

  ~> echo $(true)
  fish: $(...) is not supported. In fish, please use '(true)'.
  echo $(true)
       ^
> (I recognize not all commands can be translated, but all of those that would be run by a beginner can be)

Not all of them, unfortunately.

Consider `while true; do something; done`. Fish interprets this as an unclosed while loop, where `do` and `done` are ordinary commands. So if you enter it you don't get a syntax error, fish just waits for more input until you enter `end`. The same goes for `if` and `for`.

Re:New Features in the Fish Shell by maximilianroos on Tuesday September 29, 2020 @07:48PM (#24634410)
Good point on the loop, I hadn't thought about that, thanks for correcting me.

On the error messages, I was thinking even clearer for beginners, giving them the whole statement, to avoid uncertainties around where the quotes should be included in '(true)'. Maybe even a shortcut to paste the corrected line in their terminal.

  echo $(true)
       ^
  fish: $(...) is not supported. In fish, please use '(true)', like:

  echo (true)

  Alt+r will insert this line in your terminal.