You are not logged in.
I've just switch from urxvt to termite due to the proper support for fontconfig. However, I'm noticing an issue in some ncurses programs that make use of the "Extended ASCII character set" printing functionality
According to this question ncurses determines what characters to print for a specific extended ascii character based on the current terminal type.
I suspect that termite isn't properly reporting unicode support since when a ncurses program wants to (for example) print arrows it will print (<, ^, v, >) instead of (←, ↑, ↓, →).
I've been trying to read terminfo(5) to understand what I might need to change in the terminfo file (xterm-termite) for it to properly report that it supports unicode, but it's fairly cryptic to me.
Last edited by EvanPurkhiser (2013-05-16 07:53:26)
Offline
Works fine here:
Is your locale set correctly? You aren't setting a $TERM value in one of your shell intialization files?
Offline
Termite has no problem displaying unicode characters, but curses doesn't seem to detect that the console supports unicode characters and instead prints fallback ASCII characters.
It works ok if I export TERM=screen-256color, but not when using termites xterm-termite terminfo.
Edit: Let me see if I can make a small python example to demonstrate the problem.
Last edited by EvanPurkhiser (2013-05-11 07:12:26)
Offline
Here's an example of the problem:
#!/usr/bin/python
import curses
import time
stdscr = curses.initscr()
curses.cbreak()
curses.noecho()
stdscr.keypad(1)
try:
stdscr.addch(1,1,curses.ACS_UARROW)
stdscr.addch(1,3,curses.ACS_DARROW)
stdscr.addch(1,5,curses.ACS_LARROW)
stdscr.addch(1,7,curses.ACS_RARROW)
stdscr.refresh()
time.sleep(3)
finally:
curses.nocbreak()
stdscr.keypad(0)
curses.echo()
curses.endwin()Running that produces (^ V < >). However if you export TERM=screen-256color and run it again, you will see that termite prints (↑ ↓ ← →)
Offline
Yes, I can reproduce the issue using your script.
What curses applications are you seeing this in?
Offline
I'm seeing this problem using the transmission-remote-cli client. The "download" and "upload" arrows are shown as v and ^ instead of ↓ and ↑.
Offline
I've made a little bit of progress on determining why Termite doesn't report support for _some_ extended ASCII characters.
Looking at Termites terminfo file there is an option in there named 'acsc', which describes the terminals support for extended ascii characters. There is some documentation on the options available for this, and I noticed that the arrow characters are not included in termites terminfo.
If I switch my $TERM to screen-256color (which DOES print the extended ASCII arrows properly) and run `infocmp` I see that it does include these characters
acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,I thought I might be able to simply add the proper characters to termites terminfo acsc option and it would fix it, but it didn't. Instead now when it trys to print arrows instead of printing the wedge (^, v) or the unicode characters (like I want), it just prints the corresponding extended ASCII mapping characters (-, .).
The next thing I tried was copying ALL of the screen-256color terminfo options into the source termite.terminfo file. This had the same effect as before.
I also tried completely replacing the (already compiled) xterm-termite terminfo file with the (already compiled) screen-256color terminfo file (`cp /usr/share/terminfo/s/screen-256color /usr/share/terminfo/x/xterm-termite`). This DID work, but obviously this is no different than just `export TERM=screen-256color `
What am I missing? is there some kind of character map that gets encoded into the terminfo file during compilation?
Last edited by EvanPurkhiser (2013-05-16 07:05:02)
Offline
Got it!
TL;DR; I had to add the `U8#1` option to the terminfo source. This is an non-standard option which is why it didn't show up when I ran `infocmp` for screen-256color.
So I managed to find the source used to generate the screen-256color (the screen term actually also has proper extended ASCII UTF8 support) terminfo file (It was in the ncurses source in the file misc/terminfo.src). I noticed the `U8#1` option which I remembered seeing a little bit ago while reading the man pages for ncurses. It didn't strike me at the time, but it was exactly what I was looking for.
Here's the relevant section from the man page describing it.
I've also opened a pull request on the Termite git repository.
Last edited by EvanPurkhiser (2013-05-16 08:03:32)
Offline
Nice work Evan.
Offline