Baruch Burstein schreef op 2016-01-26 11:16:

> Hi all, 
> 
> When I run gdb in the mingw64 environment (I haven't tested others), it 
> behaves weirdly. Specifically, If I press the up arrow, instead of scrolling 
> through the previous commands, it moves the caret up on the screen, and from 
> there just goes crazy (printing text and seemingly random places on the 
> screen, no accepting commands, etc.) 
> 
> "which gdb" returns "/mingw64/bin/gdb". I am fully updated. 
> 
> Any insights?

Hi, 

This is because /mingw64/bin/gdb is a native Windows program and you are
running it in mintty which is a Unix terminal emulator. Unix terminal
emulators (PTY) work with a TTY interface. If you want to know about TTY
go here: http://www.linusakesson.net/programming/tty/ 

This problem is old and also existed with msys 1 when it used by default
an rxvt terminal (mintty did not exist yet). See for instance this
discussion: https://sourceforge.net/p/mingw/mailman/message/20318652/ 
Because many people complained about this they switched the default msys
1 terminal to a Windows Console terminal, but you can still choose rxvt
and also mintty now. 

Your solution is to run mingw-gdb in a Windows Console terminal, or a
similar like ConEmu. But then you have the problem that some msys2
applications don't work properly, because msys2 programs expect like
Unix programs a TTY interface. 

Msys2 programs work well in mintty (MINimal TTY). When you run msys2-gdb
in an msys2_shell in mintty, you don't have the problem. 
Remember that msys is a POSIX layer which makes it easy to port Unix
programs to Windows. So msys programs act as if they are on Unix/Linux.
They are ignorant of Windows. 

The same also holds for ncurses. mingw-ncurses is intended for native
Windows programs, and runs fine in Windows Console/ConEmu/ConsoleZ.
msys2-ncurses runs  fine in mintty, because msys2-ncurses expects a Unix
like environment. 
PDCurses is, like mingw-ncurses, intended for the Windows Console (an
alike). Programs built with PDCurses do not run in mintty. 

In the beginning of Cygwin there was no mintty, Cygwin ran by default in
a Windows Console like terminal. So they created the terminal type
TERM=cygwin to get IO working. It worked reasonable, but things like
resizing did not work properly. Now Cygwin uses mintty by default,
because mintty fits naturally. 

The ConEmu author seems to be working on a solution to get cygwin and
msys working properly in ConEmu. See
https://conemu.github.io/en/CygwinMsys.html 

regards, 

-- 
Erwin Waterlander
http://waterlan.home.xs4all.nl/ 
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
_______________________________________________
Msys2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/msys2-users

Reply via email to