Ncurses在Windows中提示PuTTY看起来破了
Byobu在PuTTY看起来非常破碎。 我已经修复了密钥映射问题,但是手册页甚至Google都没有指定此问题:
注意窗口列表的错位位置,选择器位置损坏,最后一个窗口的重复,右上角的随机a以及错位的应用选项。 你看不到这一点,但最后一个选项是不可选的。
在PuTTY中是否有一些选项我需要使用才能正确看到这个?
配置putty读取utf8。 putty – > config – > window – > translation选择utf in“Recieved data in …”这不是一个byobu问题,它是一个腻子问题。
也可以看看:
与Putty相关,我将此注释添加到byobu(1)联机帮助页中一段时间:
> PuTTY users have reported that the > F2, F3, and F4 shortcut keys are not > working properly. PuTTY sends the > same escape sequences as the linux > console for F1-F4 by default. You can > fix this problem in the PuTTY config, > Terminal -> Keyboard -> Function keys: > Xterm R6.
看到:
Ubuntu使用UTF-8作为其终端,但是byobu似乎使用“ISO-8859-1(西欧)”字符集作为菜单。 您可以在Window – > Translation中设置charset。
我在互联网上找到了以下代码,我仍然很满意。 byobu
可能有更多选项,但我也喜欢这个( ~/.screenrc
):
startup_message off hardstatus alwayslastline hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]%{w} %l' shelltitle "$ |bash" termcapinfo xterm ti@:te@ altscreen on
注意:对于byobu,必须删除/注释shelltitle "$ |bash"
,否则byobu将无效。
因此,对于byobu在腻子看起来不错,你应该实际做两个改变。
首先是将键盘更改为xterm-R6,如上所述,但其次,在您的linux机器上运行命令作为普通用户: byobu-select-backend
然后选择选项screen
(通常为2)。
现在应该工作得很好! 请享用!
它对我有用(适合Putty – 临时):
窗口 – >翻译 – >远程字符集:DEC-MCS
对于您的应用程序中的最终解决方案:
- 添加文件.bashrc (对于olny当前用户)或添加etc / bash.bashrc(对于所有用户)
NCURSES_NO_UTF8_ACS = 1
-
确保你有:
-
sudo apt-get -install ncurses
-
sudo apt-get install libncursesw5-dev
-
-
添加代码:
#include
#include
//change curses-------------------------------------
//add in main setlocale(LC_TYPE, ""); -
使用-lncursesw编译应用程序,如下所示:
gcc -o arquivo arquivo.c -lncursesw