News for hackers. Stuff that matters.
Re:The Terminal Escape Sequences Ocean Is Deep and Dark by kps on Wednesday January 18, 2023 @03:51PM (#34432908)
A few terminals (e.g. iTerm2) try to track the current command, presumably by looking at the children of the shell they spawn. This isn't much use when your current command is `ssh`.

You could probably have a push/pop escape sequence requiring a matching unique token that intermediate output can't guess.

    OSC 57473 ; 1 ; <token> ST
    ⋮
    OSC 57473 ; 0 ; <token> ST
Re:The Terminal Escape Sequences Ocean Is Deep and Dark by EthanHeilman on Thursday January 19, 2023 @08:30AM (#34440033)
Can bash do this? I wonder what issue I have yet to think of prevents pop/pushing escape sequences from being default behavior.
Re:The Terminal Escape Sequences Ocean Is Deep and Dark by kps on Thursday January 19, 2023 @09:09AM (#34440409)
I think with most current shells you could do this in prompt strings. Actually, you'd probably want a combo that restores the top-of-stack state and leaves it there; then you'd push the state during shell initialization and restore it in the prompt.