Two problems with sbt in cygwin / vista

前端 未结 1 1072
南笙
南笙 2021-01-12 15:28

I am using cygwin 1.77 on windows vista. I\'m facing problems with the output from sbt in the shell. Some relevant environment vars:

TERM=cygwin         


        
相关标签:
1条回答
  • 2021-01-12 15:57

    Regarding 1):

    The way the Cygwin console works is that there's a part of the Cygwin DLL that maps Unix terminal control sequences to Windows console API calls. Since that terminal emulation is part of the Cygwin DLL, it is not available to non-Cygwin programs such as the Java runtime. Instead, java will be talking directly to the Windows console, which doesn't understand escape sequences. Hence they appear directly on screen.

    There are a few ways you could address this:

    • Tell Java/Scala to use the Windows console API instead of Unix control sequences. I guess removing the -Djline.terminal=jline.UnixTerminal option would do that.
    • Set the CYGWIN=tty option. With that, programs invoked in the Cygwin console have their I/O connected to a "pseudo terminal" (pty) device instead of being connected directly to the console window. This makes the terminal emulation features available to non-Cygwin programs, but it means that programs that use the Windows console API will no longer work correctly.
    • Use one of Cygwin's other terminal emulators: mintty, xterm, rxvt(-unicode). These offer better terminal emulation and more sensible user interfaces than the default console, but again at the cost of not supporting programs that use the Windows console API.

    (Btw, the CYGWIN=server option is obsolete; the feature that it enabled is always on anyway.)

    0 讨论(0)
提交回复
热议问题