4

I just tried to get tui up and it said:

Cannot enable the TUI when output is not a terminal

Which I though was odd because I thought I had it up before. Turns out it worked when I was using cmd but doesn't work using mintty.exe. The bash shell says that TERM=xterm. I also tried some other vt terminals without success. So I'm thinking that gdb isn't respecting the TERM variable.

Anyone know anything about this?

Adrian
  • 10,246
  • 4
  • 44
  • 110

1 Answers1

0

The source code for GDB (line 380 of the linked source) uses stderr.isatty() to check whether the output file (in this case MinTTY) is a terminal or not. However, this check fails using MSYS/MinGW because, according to the developer of MinTTY,

Quoting from mingw.org: “MinGW … is a minimalist development environment for native Microsoft Windows applications.” Native Windows means no tty.

Looking at this patch suggests that a workaround may be to unset the $TERM variable to enable the native Windows console driver (rather than using a Unix tty). So try unset TERM to see if that will resolve the issue.

  • It didn't work for me. Did you try it on your machine? – HolyBlackCat Oct 16 '21 at 09:01
  • 1
    Hmm, looking at https://github.com/mintty/mintty/issues/380#issuecomment-140731216, the issue might be that windows-native applications (like msys-compiled gdb) are simply unable to interface with POSIX ttys. In which case I'm pretty sure the only solutions are either to use a POSIX-compatible gdb (I think Cygwin GDB would work), or a terminal supporting windows-native command lines (Windows terminal?) Anyway, let me know if you have any luck with either of those, I'll also try to run some tests and I'll update my answer if I find anything new – Geno Racklin Asher Oct 16 '21 at 11:29
  • I don't have a windows machine at hand. Won't be able to check before monday... – HolyBlackCat Oct 16 '21 at 17:43