This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] Cygwin: pty: Disable clear screen on new pty if TERM=dumb or emacs*.


On 2019-09-04 19:13, Takashi Yano wrote:
> On Wed, 4 Sep 2019 11:22:42 -0600
> Brian Inglis wrote:
>> That output seems to be generated by a shell or program running in the pty.
>> If the recipient can not handle escape sequences, then the shell or program in
>> the pty should be configured by setting e.g. TERM=dumb when launching the
>> terminal, or in the shell environment.
> 
> No. Output is almost same even if setting TERM=dumb.
> See attached log.
> 
> Consider what should be the output of pseudo console if console
> application like below is executed.
> 
> #include <windows.h>
> 
> int main()
> {
>     HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
>     COORD p = {20, 10};
>     DWORD n;
>     SetConsoleCursorPosition(h, p);
>     SetConsoleTextAttribute(h, FOREGROUND_RED);
>     WriteConsole(h, "R", 1, &n, 0);
>     SetConsoleTextAttribute(h, FOREGROUND_GREEN);
>     WriteConsole(h, "G", 1, &n, 0);
>     SetConsoleTextAttribute(h, FOREGROUND_BLUE);
>     WriteConsole(h, "B", 1, &n, 0);
>     SetConsoleTextAttribute(h, FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);
>     WriteConsole(h, "W", 1, &n, 0);
>     WriteConsole(h, "\r\n", 2, &n, 0);
>     return 0;
> }
> 
> Setting cursor posision and text color cannot be realized
> without ANSI escape sequences.
> 
> Indeed, the output of the pseudo console by the program above is:
> ^[[?25l^[[11;21H^[[?25h^[[?25l^[[31mR^[[32mG^[[34mB^[[mW^M
> ^[[?25h

So how do you tell the pseudo-console to generate only text not escape sequences
the recipient may not be prepared to deal with?

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]