Running ncurses-linked MinGW apps from MSYS Bash

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Running ncurses-linked MinGW apps from MSYS Bash

Eli Zaretskii
When a MinGW program linked with libncurses is run from the MSYS Bash,
it sees TERM=cygwin in the environment, and libncurses then uses the
terminfo data for that terminal, instead of using its internal Windows
console driver.  However, using the cygwin terminfo entry doesn't work
well: e.g., the "clear to end of line" sequence ("\E[K" according to
"infocmp cygwin") appears verbatim instead of actually erasing text.

I'm guessing that this doesn't work because the necessary magic for
interpreting these sequences is inside the MSYS DLL, and so won't work
in any non-MSYS program.  Is that correct?

If so, then it is not really appropriate for MSYS to leave this
variable in the environment, when it invokes native programs, I think.
(There's a work-around of using "env -u", but it's an annoyance to
remember to type that, and when MinGW programs are invoked via shell
scripts that also invoke MSYS programs, the annoyance becomes real
trouble.)

Or am I missing something?

TIA

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Running ncurses-linked MinGW apps from MSYS Bash

Earnie Boyd
> From: Eli Zaretskii
>
> When a MinGW program linked with libncurses is run from the MSYS Bash, it
> sees TERM=cygwin in the environment, and libncurses then uses the terminfo
> data for that terminal, instead of using its internal Windows console
driver.
> However, using the cygwin terminfo entry doesn't work
> well: e.g., the "clear to end of line" sequence ("\E[K" according to
"infocmp
> cygwin") appears verbatim instead of actually erasing text.
>
> I'm guessing that this doesn't work because the necessary magic for
interpreting
> these sequences is inside the MSYS DLL, and so won't work in any non-MSYS
> program.  Is that correct?
>

I believe so but does TERM=xterm help?

Earnie


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Running ncurses-linked MinGW apps from MSYS Bash

Eli Zaretskii
> From: "Earnie" <[hidden email]>
> Date: Mon, 5 Jan 2015 18:04:21 -0500
>
> > From: Eli Zaretskii
> >
> > When a MinGW program linked with libncurses is run from the MSYS Bash, it
> > sees TERM=cygwin in the environment, and libncurses then uses the terminfo
> > data for that terminal, instead of using its internal Windows console driver.
> > However, using the cygwin terminfo entry doesn't work
> > well: e.g., the "clear to end of line" sequence ("\E[K" according to "infocmp
> > cygwin") appears verbatim instead of actually erasing text.
> >
> > I'm guessing that this doesn't work because the necessary magic for interpreting
> > these sequences is inside the MSYS DLL, and so won't work in any non-MSYS
> > program.  Is that correct?
> >
>
> I believe so but does TERM=xterm help?

No, it doesn't.

Anyway, how is that different from unsetting TERM before running such
programs?

Or are you saying that it's safe to set TERM-xterm permanently in the
MSYS Bash session?  I always thought that it is set to "cygwin" for a
reason.  If not, then perhaps unsetting it is the solution?

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: Running ncurses-linked MinGW apps from MSYS Bash

Earnie Boyd
> From: Eli Zaretskii
> > From: "Earnie" <[hidden email]>
> > Date: Mon, 5 Jan 2015 18:04:21 -0500
> >
> > > From: Eli Zaretskii
> > >
> > > When a MinGW program linked with libncurses is run from the MSYS
> > > Bash, it sees TERM=cygwin in the environment, and libncurses then
> > > uses the terminfo data for that terminal, instead of using its
internal

> Windows console driver.
> > > However, using the cygwin terminfo entry doesn't work
> > > well: e.g., the "clear to end of line" sequence ("\E[K" according to
> > > "infocmp
> > > cygwin") appears verbatim instead of actually erasing text.
> > >
> > > I'm guessing that this doesn't work because the necessary magic for
> > > interpreting these sequences is inside the MSYS DLL, and so won't
> > > work in any non-MSYS program.  Is that correct?
> > >
> >
> > I believe so but does TERM=xterm help?
>
> No, it doesn't.
>
> Anyway, how is that different from unsetting TERM before running such
> programs?
>
> Or are you saying that it's safe to set TERM-xterm permanently in the MSYS
Bash
> session?  I always thought that it is set to "cygwin" for a reason.  If
not, then
> perhaps unsetting it is the solution?

Well, I had changed to the original cygwin TERM to msys instead when I
created it.  
But I see no reason you wouldn't be able to use MSYS without the TERM
variable set.  Cygwin/MSYS assumes a default.

--
Earnie


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe