Ubuntu 9.04 的正确 Putty 配置
我经常使用 Putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/) 连接到 Ubuntu 盒子(现在 9.04)。 它运行良好,但我无法找出 Ubuntu 端 Putty 字体、字符编码、字符翻译和终端配置的正确组合,以便终端正确显示所有内容。 当运行 ncurses 程序(例如“screen-profiles”或“w3m”)时,该问题最为明显。 方框图字符混乱。
有人对这种组合感到满意吗?
I often use Putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/) to connect to Ubuntu boxes (9.04 now). It works well, but I can't figure out the correct combination of Putty font, character encoding, character translation, and terminal configuration on the Ubuntu end so that the terminal displays everything correctly. The problem is most obvious when running an ncurses program such as "screen-profiles" or "w3m". The box drawing characters are messed up.
Has anyone got this combination working to their satisfaction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
尝试导出以下环境变量
export NCURSES_NO_UTF8_ACS=1
这将停止在 UTF-8 语言环境中使用 VT100“备用字符集”线条绘制字符的 ncurses,并使其使用 Unicode 框绘制字符。
Try exporting the following environment variable
export NCURSES_NO_UTF8_ACS=1
That stops ncurses using the VT100 "Alternate character set" line drawing characters in a UTF-8 locale, and makes it use the Unicode box-drawing characters instead.
我能想到的最好办法是将 Window/Translation 中的 putty 配置更改为 UTF-8,并将 Window/Appearance 中的字体更改为 Lucida Console。
它使大多数字符正确。 在“aptitude”中,菜单以线条画字符正确勾勒出轮廓,但不是“您确定要退出吗”弹出对话框。 运行“man ls”等命令现在可以正确显示大多数字符,但连字符的单词最终会用一个框替换连字符。
无论如何,对于在 Emacs 中编程来说已经足够了。 更好的解决方案受到赞赏。
The best I've been able to come up with is to change the putty configuration in Window/Translation to UTF-8 and the font in Window/Appearance to Lucida Console.
It gets most of the characters correct. In "aptitude" the menus are correctly outlined in line drawing characters, but not the "Are you sure you wish to exit" pop up dialog. Running a command like "man ls" now shows most of the characters correctly, but hyphenated words end up with a box replacing the hyphen.
It's good enough for programming in Emacs, anyway. Better solutions appreciated.
Putty(或增强型 fork Kitty)显然都不会满足在“UTF-8”中切换到 VT100 样式线条绘制模式的请求,例如在
aptitude
中 - 这是设计使然(http://www.chiark.greenend.org。 uk/~sgtatham/putty/wishlist/utf8-plus-vt100.html)。但是,如果我们设置“连接>” 数据> 终端类型字符串'
使用“putty”而不是默认的“xterm”可以解决问题,因为服务器会调整渲染字符。
我相信这个解决方案比使用我自己到目前为止使用的
export NCURSES_NO_UTF8_ACS=1
更好。Putty (or enchanced fork Kitty) appernetly both don't honor the request to swtich to VT100 style line drawing mode when in 'UTF-8' for example in
aptitude
- this is by design (http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/utf8-plus-vt100.html).However if we set 'Connection > Data > Terminal-type string'
to 'putty' instead of the default 'xterm' it solves the issues because the server adjusts the rendering characters.
I believe this solution is better then using
export NCURSES_NO_UTF8_ACS=1
which I have used up until now myself.就我而言,它不是 ncurses,也不是 putty。 这是语言环境,未设置为 UTF-8...
因此
locale
调用产生了以下结果。然而,需要的是
我能够通过
In my case, it wasnt ncurses, nor putty. It was the locale, which was not set to UTF-8...
so
locale
call yielded the result below.However, whats needed was
And i was able to achieve that by
不是为了挖掘旧帖子,而是 KiTTY (PuTTY 分支)提供了一个“允许 ACS 行”的复选框以 UTF 绘图”(新/当前会话设置 -> 窗口 -> 翻译),这似乎与 aptitude 等应用程序配合良好。 我刚刚下载了最新版本的 PuTTY,并且此复选框不存在,因此它一定是 KiTTY 特定的。
对于当前的问题,其他答案并没有错; 这只是附加环境变量或更改公布的终端类型的替代方案。 (如果您使用的是 screen/,另请参阅 https://stackoverflow.com/a/8485457/1011365 了解更多信息/ tmux 以及 termcap 是如何参与的,尽管仅供参考,我使用的是最新的 tmux,并且仍然需要选中 KiTTY 中的复选框以允许字符正确显示)
Not to dig up an old post, but KiTTY (a PuTTY fork) provides a checkbox to "Allow ACS line drawing in UTF" (new/current session settings->Window->Translation) which seems to work well with apps like aptitude. I just downloaded the latest version of PuTTY, and this checkbox is not present, so it must be KiTTY specific.
The other answers are not wrong about the issue at hand; this is just an alternative to additional environment variables or changing the advertised terminal type. (see also https://stackoverflow.com/a/8485457/1011365 for more info if you're using screen/tmux and how termcap is involved, though FYI I'm using an up-to-date tmux and still needed to check the box in KiTTY to allow the characters to appear correctly)
我主要使用 Putty 来与我的 Ubuntu vm-boxen 交互,所以我确实花了一些时间来正确地进行可视化配置。 基本上,我将字体设置为 MS Gothic、9pt(用于等宽字体和日语),接收数据设置为 UTF-8,并将终端类型字符串设置为 xterm-256color。 我保留了大部分终端设置,因为默认设置似乎运行良好。
在 Ubuntu 方面,我设置了
LANG=en_US.UTF-8
、aptitude install ncurses-term
作为附加条款。 我通过 nice script 检查终端颜色,并在GNU Screen
会话和GNU Emacs
(Mx list-colors-display
)。GNU Screen
未使用 256 色选项编译,因此我重新编译它。 我使用Emacs
(Mx view-hello-file
) 以及tig
一个git
目录来检查语言i18n utf-8 日志提交。不幸的是,我仍然在
aptitude
上得到了奇怪的“lqqqqk”的东西(线条艺术丢失了?),但间距仍然是正确的。 另外,在aptitude
中按退格键会插入字符,但我仍然没有克服这一点。 我还在我的系统上测试了你的命令行 w3m,它看起来不错。 不过,我更喜欢使用 emacs 中的 w3m。 :-)说实话,我使用 日本 Putty 分支 Gottani(PuTTY ごった煮版) 对日语有更多帮助,但我认为它非常接近普通的 Putty。
旁白:我还设置了 Terminal > 特点>> 禁用远程控制终端调整大小,因为“GNU Screen”覆盖了我的窗口大小设置。
以上所有内容均在 Ubuntu 8.04 LTS“Hardy Heron”上进行了测试。
I use Putty mainly to interact with my Ubuntu vm-boxen so I do spend some time getting the visual configuration correct. Basically, I set the font to MS Gothic, 9pt (for monospaced and Japanese), UTF-8 for received data, and terminal-type string to
xterm-256color
. I leave most of the Terminal settings alone because the defaults seem to work well.On the Ubuntu side, I set
LANG=en_US.UTF-8
,aptitude install ncurses-term
for additional terms. I check the terminal colorness via a nice script, and double check within aGNU Screen
session andGNU Emacs
(M-x list-colors-display
).GNU Screen
is not compiled with 256 color option so i re-compile it. I check the language by usingEmacs
(M-x view-hello-file
) and alsotig
agit
directory with i18n utf-8 log commits.Unfortunately I still do get the weird "lqqqqk" thing on
aptitude
(line art missing?) but the spacing is still correct. Also pressing backspace inaptitude
does a character insert, which I still have not conquered. Also I tested your command line w3m on my system and it looks nice. I rather use w3m from emacs, tho. :-)Truth be told, I use a Japanese fork of Putty called Gottani (PuTTY ごった煮版) that helps more with Japanese but I think its pretty close to the normal Putty.
Aside: I also set Terminal > Features > Disable remote-controlled terminal resizing because `GNU Screen" overrides my window size setting.
All of the above is tested on Ubuntu 8.04 LTS "Hardy Heron".