[erlang-questions] Can't update xterm title bar from Erlang

Alex S. alex0player@REDACTED
Mon May 15 12:17:52 CEST 2017


What I’ve noticed is you don’t output the line feed, which might mean that the IO buffer isn’t getting flushed by default. Although I am not sure.
> 12 мая 2017 г., в 22:28, Roger Lipscombe <roger@REDACTED> написал(а):
> 
> I have the following:
> 
>     put_progress(Format, Args) ->
>         io:put_chars(user,
>                      [tsl(), io_lib:format(Format, Args), fsl()]),
>         io:put_chars(user,
>                      [colored(), io_lib:format(Format, Args), reset(), "\n"]),
>         ok.
> 
>     tsl() -> "\e]0;".
>     fsl() -> "\a".
>     colored() -> "\e[1;44m".
>     reset() -> "\e[0m".
> 
> That is: output the same message to the title bar (tsl, fsl are the tput capability names; see https://serverfault.com/a/23998/7027 <https://serverfault.com/a/23998/7027>), and then (for now) also output it in colour, so that I can see if it's being called correctly.
> 
> Unfortunately, something is messing with my tsl() and fsl() escape codes. The coloured text is coming out correctly, but the other stuff's garbage. The escape codes are correct; I've tested them at the bash prompt with "echo -e '\e]0;Hello\a'".
> 
> So... what's screwing with them when they're output from ct_run?
> 
> Interestingly, if I try the same at the Erlang prompt, it hangs the shell until I press Ctrl+C twice, at which point the text is output, but still messed up.
> 
> Cheers,
> Roger.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170515/6c60b8c8/attachment.htm>


More information about the erlang-questions mailing list