Closed choldrim closed 7 years ago
Could you give an example of the input which triggers the bug along with the expected/observed behaviour?
Hi @choldrim, could you have a look at #80 and tell me if this is the bug you've experienced?
Hi @superbobry
I'm sorry for replying this so late.
This string \x1b[3J\x1b[H\x1b[2J\x1b]0;
, which is replied from server while I input clear
in terminal, trigger this bug, and I get the value how
which is 4, not in [0, 1, 2]
.
Thanks! #80 mentions how == 3
, which is a fairly recent addition to TERM=linux
. Which TERM
do you have?
TERM=xterm
pyte
only aims to support TERM=linux
for now with some minor extensions pulled from xterm
(like colour support). Therefore, it is recommended to use TERM=linux
for running apps inside pyte
.
Ideally, we should not handle how > 3
at all, and just render the CSI sequence as-is. It is probably best to do this directly in Screen
without complicating the already complex parser in Stream
.
Thank you for reporting this.
I am using pyte
with paramiko(something like ssh), and I tried to change the TERM
with export TERM=linux
, however it didn't work(it might be a wrong way to do this).
I am not really clear about the difference between TERM=linux
and TERM=xterm
. As for me, I just feel nothing different excepting the clear
command.
Well, in short, I mean, is there any way to use pyte
under ssh
?
Well, in short, I mean, is there any way to use pyte under ssh?
I think the value of TERM
variable should be defined on the machine you're connecting to, i.e. somewhere in the remote .bashrc
. Could you confirm that you've exported it remotely and not locally?
If the TERM
trick still doesn't work, I can add a quickhack so that pyte
ignores inputs it cannot interpret.
Could you confirm that you've exported it remotely and not locally?
Yes, I am sure it has been exported remotely. But, event if exporting TERM=linux
on the server, I get the same problem, and the value of how
is also 3.
Or you can try it by yourself with some python ssh lib like paramiko
before adding a patch for this.
Thanks 👍
Hi @choldrim, could you give the master
version a try? I've added support for how=3
, so TERM=linux
should now work.
Hi @superbobry , the master
branch works well now. 👍
Awesome! Closing the issue.
By the way, don't hesitate to add your project to Pyte users section here.
By the way, don't hesitate to add your project to Pyte users section here.
Okay, I will push a PR later. :)
https://github.com/selectel/pyte/blob/master/pyte/screens.py#L700
There is a potential bug here, which will be triggered while
how
var isn't in the list [0, 1, 2].