[PATCH] Cygwin: console: Fix segfault on shared_console_info access.

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Feb 25 09:17:00 GMT 2020


On Feb 25 12:53, Takashi Yano wrote:
> On Tue, 25 Feb 2020 12:08:16 +0900
> Takashi Yano wrote:
> > On Mon, 24 Feb 2020 19:33:18 +0100
> > Corinna Vinschen wrote:
> > > Is there some kind of workaround for that problem?  Otherwise defaulting
> > > to a (broken) xterm mode instead of a (working) cygwin mode is a bit
> > > questionable, isn't it?
> > 
> > In my environment, legacy cygwin mode is not 'working' with
> > gray background and black foreground.

I'm using the windows console with grey background and black
foreground for ages.  Apart from bugs we had in the past, this
setting always worked as expected, except in some border cases.

What's important is that you start your shell from a shortcut
with these console settings.  I.e., you have to change the
settings in the shortcut properties.  Otherwise, if you start
the shell with default grey on black and just switch the color
settings on the fly for this console, there will always be
artifacts.  Somehow the legacy console doesn't like switching
colors during a session that much.

> > You can confirm what
> > happens if xterm mode is disabled by reverting cygwin to 3.0.7.

I simply set has_con_24bit_colors to false and rebuilt the DLL.
With this enforced cygwin term setting, my vim example works
fine, just as /bin/echo -e '\033[H\033[5L'

> > If you type 'aaa' in shell prompt and hit backspace, then
> > whole line after cursor gets black. Furthermore, if you run
> > vim, whole screen gets into black background and gray fore-
> > ground.
> > 
> > Do not these happen in your environment?

No, as I wrote, it works as expected and the background stays
grey.

> > Oh, wait. I was setting foreground and background color in
> > "terminal" tab in property. If I set them in "colors" tab,
> > cmd.exe behaves differently. In this setting, your problem
> > does not seems to occur.
> 
> I was wrong. The problem also occur with "colors" tab setting.
> However, in this case, ScrollConsoleScreenBuffer() test case
> does not cause the problem. Therefore it may be possible to
> make a workaround for this. I will try.

That would be great!


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20200225/a4fa48a4/attachment.sig>


More information about the Cygwin-patches mailing list