On Sat, 8 Feb 2020 23:29:09 +0800 Koichi Murase wrote: > > The pseudo console has its own screen buffer behind, and redraws the > > screen based on the screen buffer at undetermined timing. > > I'm not sure if I correctly understand the situation, but does this > mean we cannot prevent the pseudo console from redrawing the screen > (i.e., sending some texts and escape sequences to the terminal > emulators) based on its background screen buffer? For that reason do > we need to keep the terminal contents of both the terminal emulator > and the background screen consistent with each other?
I think you understand correctly. Due to the reason above, pty sends data written by slave to both native screen and pseudo console. However, the interpretation of escapce sequence does not match perfectly between the real native screen and pseudo console, therefore, screen is changed when redraw screen is triggered. > > > * The problem is not restricted in just clearing graphic styles of > > > characters. For GNU Screen I use Screen-specific terminal sequences > > > (snip) > > > > How can I reproduce this? > > For example, in GNU screen, > > [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ > $BASH_COMMAND\e\\\][\u@\h \j \W]\$ ' > [user@hostname 0 ~]$ > [user@hostname 0 ~]$ > [user@hostname 0 ~]$ > [user@hostname 0 ~]$ > [user@hostname 0 ~]$ > [user@hostname 0 ~]$ > [user@hostname 0 ~]$ > [user@hostname 0 ~]$ ./nocyg > > where ./nocyg is the program in the original mail. Then it turnes > into something like: > > [user@hostname 0 ~]$ PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h > \[\e[33m\]\w\[\e[[user > @hostname 0 ~]$ PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[ > [user@hostname 0 ~]$ PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[ > 0m\]\n\$ '[user@hostname 0 ~]$ > > [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j > \W]\$ '[user@hostname 0 ~]$ > [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j > \W]\$ '[user@hostname 0 ~]$ > [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j > \W]\$ '[user@hostname 0 ~]$ > [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j > \W]\$ '[user@hostname 0 ~]$ > [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j > \W]\$ '[user@hostname 0 ~]$ > [user@hostname 0 ~]$ PS1='\[\ek[\u@\h \j \w]$ $BASH_COMMAND\e\\\][\u@\h \j > \W]\$ '[user@hostname 0 ~]$ ./nocyg > [user@hostname 0 ~]$ Hmmm, this is terrible indeed... I hope there could be a solution. -- Takashi Yano <takashi.y...@nifty.ne.jp> -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple