L'uso di questo sito
autorizza anche l'uso dei cookie
necessari al suo funzionamento.
(Altre informazioni)

Thursday, March 13, 2014

^[[?1034h is in our files. We are not amused.

And so while I am busily coding stuff for our internal revamped monitoring system (nagios, smokeping, graphite and sundry  software packeges), the exceedingly weird [?1034h sequence began showing sometimes up at the end of json files I generete to create graphical dashboards, messing stuff up beyond repair.

The pesky string is (as adroitly pointed out in this post) a terminal escape sequence, namely, the smm capability (Meta Mode On) for xterm  definition in terminfo. The same post suggests - correctly - that unsetting the TERM environment variable makes the problem disappears. Which I did, thusly:

# Avoid weird escape sequences in output
delete $ENV{TERM};

Why should this be happening tho'? It's not perl specific (it's hitting python too, so there). It should be related to running (interactive) shell commands - that's when the terminal rendering stuff is initialized - but I am not knowingly doing it. Even more creepily, it does not show up in all the files I am generating: so far, I have seen it once.

Google is not helping, a part from confirming that more than a few have seen this happening. And the rest is silence.


As this post makes clear, it could be a bug in some system IO libraries, somehow related to readline:

# $ python -c 'import readline' |less

Well, needless to say, I am not explicitly using readline, but still.

No comments: