不同终端的nCurses行为不同 [英] Different nCurses behaviours with different terminals
问题描述
我使用不同的终端获得两种不同的行为,这是我的代码:
I obtain two different behaviours using different terminals, this is my code:
(use ncurses)
(initscr)
(curs_set 0)
(noecho)
(start_color)
(define win (newwin 20 50 1 1))
(wclear win)
(box win 0 0)
(for-each (lambda (y)
(for-each (lambda (x)
(mvwaddch win y x #\. ))
(iota 49)))
(iota 19))
(wrefresh win)
(wgetch win)
(endwin)
该代码是用Chicken Scheme编写的,但是熟悉nCurses的任何人都可以轻松阅读.我认为我的问题与库无关,因为它是调用C函数的简单包装.
The code is written in Chicken Scheme but it's easily readable by anyone who knows nCurses. I think my problem doesn't concern the library because it's a simple wrapper which calls the C functions.
但是,如果我使用xterm,uxterm或可以通过CTRL-ALT-F1输入的linux终端,则会得到正确的行为(一个框式窗口).
However, I get the correct behaviour (a boxed window) if I use xterm, uxterm or the linux terminal you can enter with CTRL-ALT-F1.
.................................................┐
.................................................│
.................................................│
.................................................│
.................................................│
.................................................│
.................................................│
.................................................│
.................................................│
.................................................│
.................................................│
.................................................│
.................................................│
.................................................│
.................................................│
.................................................│
.................................................│
.................................................│
.................................................│
└────────────────────────────────────────────────┘
但是,如果我使用gnome-terminal,terminator或sakura等其他终端,我会得到:
But if I use any other terminals like gnome-terminal, terminator or sakura I get this:
.┐
.│
.│
.│
.│
.│
.│
.│
.│
.│
.│
.│
.│
.│
.│
.│
.│
.│
.│
└─┘
我不认为这是库故障,但我可以尝试用C重写示例(我的C有点生锈).
I don't think it's a library fault but I can try to rewrite the example in C (my C is a little rusted).
推荐答案
这听起来好像您的TERM
变量设置为 xterm
,这有时会给基于VTE的终端产生问题(gnome终端等).这是一个常见问题解答( 为什么不只是将TERM设置为"xterm"? ).
That sounds as if your TERM
variable is set to xterm
, which occasionally produces problems for the VTE-based terminals (gnome-terminal, etc). It's an FAQ (Why not just use TERM set to "xterm"?).
这不是错误(无论如何,这都是错误).
It's not a bug (in ncurses, at any rate).
如果您有完整的终端数据库,则将其设置为 vte
即可.
Setting it to vte
will work if you have a complete terminal database...
这篇关于不同终端的nCurses行为不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!