The past months, I have been developing a program written in the beautiful and fun language of Python during my spare hours on board Elida. It is too early to reveal any details, but I do feel excited about the program and its features, and I hope to make a first alpha
release next year.
The program uses the ncurses library, which is a standard tool used by almost anybody who develops graphical applications that run on the Linux and Unix console. However, the Python implementation seems to have several shortcomings, some that have caused trouble for me.
First off is the apparent lack of support for wide characters. It might just be that the Python packages I use are not compiled with support for wide characters. Wide characters means letters and characters Unicode character set, supporting any letter in any language through all known history, compared to 256 characters that the standard ASCII character set supports. When displaying strings with these extended characters, my program just displays garbled text. Solution: Filter out all non-ASCII characters (ugly)
Then is the troubles of inputting key codes. When I press different control characters on the console, “Ctrl-J” is the same as “Enter”, “Ctrl-H” is the same as Backspace and so on. I want to take use of the combination Ctrl-J and Ctrl-H, but that means that the Enter and Backspace keys get the same actions. That is not what I want. I have looked at the source code of ncmpc, an excellent music player program that uses curses in a similar manner to my program, and it seems to get different key codes for Ctrl-J and Enter, which of course makes me jealous.
On board the ship I have just to little possibility to get out on the Internet to make a thorough research on these issues, but by reading my offline documentation for Python and Curses, I get the impression that the curses support is just not ready for prime-time yet. Is there anybody out there who happens to know more about this issue, or that even has any experience developing with this toolkit? I would love some input on this, since I feel a bit confused about everything right now.