I know that there are ten different alternatives. Why don’t we simply improve the basic stuff?

  • palordrolap@kbin.social
    link
    fedilink
    arrow-up
    2
    ·
    7 months ago

    Most shells will issue $PS2 as the continuation prompt if you quote a filename and try to insert a carriage return.

    Ctrl-V Ctrl-J is the explicit keypress pair to insert a carriage return without triggering $PS2, but beware: If the carriage return is outside of quotes, that’s equivalent to starting a new command in much the same way a semicolon or a new line in a shell script would.

    echo "hello^V^Jthere" [Enter] echoes hello on one line and then there on the next, but echo hello^V^Jthere [Enter] will echo hello then try to run a command called there

    We’d have to assume that whatever fixes spaces in filenames would also have an option to fix this subtlety. And I say to whoever tries: Good luck with that.