MinTTY Unicode Support and Build Error
I'm trying to use MinTTY with MSYS (downloaded from here), and I've noticed that it doesn't seem to have Unicode support.
i.e.:
I can't paste Unicode text into it (it turns out garbage).
If I
cat
a Unicode file to the terminal (whether UTF-8 or UTF-16) I get back garbage.If I use
ls
and a file name is Unicode, it prints out garbage. Piping the result to a file does not help -- it's still garbage even when viewed in a text editor with Unicode support.I can't figure out how the
UTF-8
setting in the seettings works. It doesn't seem to change anything.When I try to download the source and build it, I get build errors that I can't solve:
Makefile:117: charset.d: No such file or directory Makefile:117: child.d: No such file or directory Makefile:117: config.d: No such file or directory Makefile:117: ctrls.d: No such file or directory Makefile:117: minibidi.d: No such file or directory Makefile:117: std.d: No such file or directory Makefile:117: term.d: No such file or directory Makefile:117: termclip.d: No such file or directory Makefile:117: termline.d: No such file or directory Makefile:117: termmouse.d: No such file or directory Makefile:117: termout.d: No such file or directory Makefile:117: winclip.d: No such file or directory Makefile:117: winctrls.d: No such file or directory Makefile:117: windialog.d: No such file or directory Makefile:117: wininput.d: No such file or directory Makefile:117: winmain.d: No such file or directory Makefile:117: winprint.d: No such file or directory Makefile:117: wintext.d: No such file or directory Makefile:117: wintip.d: No such file or directory Makefile:117: xcwidth.d: No such file or directory Makefile:117: res.d: No such file or directory windres --preprocessor 'gcc -E -xc-header -DRC_INVOKED -MMD -MP 'res.rc res.o gcc xcwidth.c -c -MMD -MP -include std.h -std=gnu99 -Wall -Wextra -Werror -Wundef -march=i586 -mtune=pentium-m -DNDEBUG -fomit-frame-pointer -Os In file included from <command-line>:0:0: ./std.h:4:28: fatal error: cygwin/version.h: No such file or directory compilation terminated. make: *** [xcwidth.d] Error 1
Questions:
Is it possible to somehow get Unicode support in MSYS/MinTTY (it seems to be an issue with both)?
If not, then where do I get all those files like开发者_运维技巧
charset.d
, and how do I build MinTTY for MSYS?
Mintty does support UTF-8. You can enable it on the Text page of its options.
MSYS does indeed not support it though. Instead, it uses the system's "ANSI" codepage, e.g. CP1252 on US and Western European systems. Therefore, that's what mintty for MSYS defaults too as well.
Furthermore, MSYS bash is set up such that it interprets the top bit of each character as the meta flag, so by default it can't handle anything beyond ASCII. To change that, put the following into ~/.inputrc
:
set input-meta on
set output-meta on
set convert-meta off
For full Unicode support (out-of-the-box), you need to use Cygwin 1.7 instead of the Cygwin 1.3 fork that is MSYS.
MSYS mintty needs to be built with the MSYS versions of gcc and make instead of the MinGW ones, because it requires POSIX functionality not provided by MinGW. Install them with mingw-get install msys-gcc msys-make
, and stick the MSYS executables at the front of the path when running them: PATH=/bin:$PATH make
.
精彩评论