Hey Andreas

Thanks for the thorough answer. I guess I wouldn't expect tmux to interpret 
any of the output as input.
Sounds like I am wrinting a small filter or continuing this project outside 
of tmux for now then. 

Thanaks for the help!
Regards,
Rickard

söndag 1 augusti 2021 kl. 10:12:34 UTC+2 skrev [email protected]:

> On 31.07.21 12:33, Rickard Carlsson wrote:
> > When I run the following julia script in tmux it just stops on the print
> > statement on the 39th and 40th iteration.
>
> The line starting with "40 Message" contains an undefined/never-ending 
> ANSI escape sequence:
>
> $ grep -a '^40 Message' output | hexdump -C
> 00000000 34 30 20 4d 65 73 73 61 67 65 3a 20 33 1f 1f 1b |40 Message: 3...|
> 00000010 19 1e 17 50 3d 33 57 03 50 1c 19 1b 15 50 11 50 |...P=3W.P....P.P|
> 00000020 00 1f 05 1e 14 50 1f 16 50 12 11 13 1f 1e 0a |.....P..P......|
> 0000002f
>
> The byte 0x1b (last one in the first line) starts the escape sequence 
> ("ESC["). But the following bytes (0x19, 0x1e, 0x17) are outside the 
> allowed values and tmux seems to ignore them.
> It then comes across 0x50 which is the control code for starting a device 
> control string (DCS). Now it collects all the rest of the bytes until it 
> finds the string terminator (ST, "ESC[\" or 0x1b 0x5c). But there is no 
> such sequence in the rest of your output so there's nothing else to output.
>
> Here are some demo strings which should explain tmux's behavior:
>
> $ echo -e '\x1b\x12\x13foobar'
> oobar
>
> (0x12 and 0x13 are ignored, ESC[f does nothing, rest is output)
>
> $ echo -e '\x1b\x12\x50foobar'
>
> (no output because 0x50 starts a never ending DCS)
>
> $ echo -e '\x1b\x12\x50foobar\x1b\x5cHello'
> Hello
>
> (everything between 0x50 and 0x1b 0x5c is interpreted as DCS (which 
> probably does nothing) and the rest is output)
>
> In general I don't think you can expect any reasonable behavior if you 
> interpret random binary data as text.
>
> Bye, Andreas
>

-- 
You received this message because you are subscribed to the Google Groups 
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/tmux-users/52404ff1-ab9a-4541-89d9-54caffabc330n%40googlegroups.com.

Reply via email to