Closed probstj closed 8 years ago
I see two ways, apart from setting the environment variable.
First one is to recompile vte library with --with-default-emulation=linux
option. I used old vte version, 0.24.3, probably couldn't bulid newer one with ancient kindle environment. Default emulation type for this vte version is xterm
. Then you would have to recompile kterm with your new static vte library.
Second option is to implement the new feature, allowing setting emulation type from config file and/or from command line option. This should be pretty simple using vte_terminal_set_emulation()
function. The time consuming part would be building and testing on different devices. I don't have time to fiddle with that now, maybe later. Also I only have old Kindle Touch to work on. Maybe you feel like contributing this feature? :)
@bfabiszewski: FWIW, I ship a stripped down terminfo DB with USBNetwork to make curses applications happy, and hardcode the TERMINFO env var as-needed (for htop, for example).
Thanks for the quick replies! Yes, I feel like contributing, it's just that it will be a first for me, so no guarantee it will work out at the end. Thanks for so far pointing in the right direction(s).
Now, the question is, which one of the three options would be the best? I like both bfabiszewski's second option and NiLuJe's. In future firmwares, more termcap files could go, so NiLuJe's approach seems more stable. I found the stripped down terminfo DB in USBNetwork, which could be reused. If I understand correctly, vte_terminal_set_termcap can be used to hardcode the new DB location.
In either case, I need to learn how to cross compile for the kindle. I'll work on that next.
Maybe the best solution would be to combine my second option with NiLuJe's approach. I think it would be best not to hardcode the path though. Maybe we could implement two new config/command line options?
vte_terminal_set_emulation()
vte_terminal_set_termcap()
(should also set environment variable TERMINFO to the new path, so that console apps could find custom database). The problem is the old version of vte widget has only function to read termcap file, and not terminfo compiled database. Hence your custom path should contain both terminfo (for modern applications) and matching termcap file (for vte). At least this is my understanding.Regarding cross compilation you will have to find your own way. I am still using scratchbox2 but this project is long dead and probably not recommended any more.
Yes, I agree, that's a good idea! Sorry, maybe you noticed from my last post, I wasn't aware that terminfo and termcap are different things. But now I am wiser. :) So we need the compiled terminfo database and TERMINFO env var for curses console apps going to be run in kterm, that makes sense. But the termCAP file is only needed for the vte widget? I can start kterm on my kindle without modifications, only curses apps won't run from kterm. Does that mean amazon only removed xterm terminfo, not xterm termcap file? Which termcap file is kterm using? Or do we maybe not need a termcap file at all?
Update: I just found the file /etc/termcap on the PW2. The file has xterm info in it, so this might be the file kterm reads.
I think we should keep emulation type synchronised between terminal and apps to avoid possible problems. Kterm loads terminal capabilities from termcap
file (/etc/termcap
by default). Default type is xterm
, which is then advertised by setting env variable TERM
. Console applications started from kterm try to load terminal settings for the advertised type. Most of them will look for relevant terminfo
database.
I made some changes to the project recently. I also tried to implement the ideas from this thread. But after closer investigation I gave up. vte_terminal_set_emulation()
function seems to be unreliable and, as such, it was depreciated and removed in subsequent versions of libvte.
Instead I decided to bundle both termcap and terminfo databases with kterm (thanks @NiLuJe !).
I believe it should resolve the problem with "unknown terminal type".
If the problem persists please reopen this issue.
I have a kindle PW2 with firmware 5.6.5. kterm loads, but running certain things, e.g. 'top' or frotz does not work. Error messages are: 'xterm':unknown terminal type or in case of frotz: "Error opening terminal: xterm"
in /usr/share/terminfo/, there is no x/xterm etc., so probably it got removed by amazon.
The above commands work if I issue export TERM=linux
Is it possible to change the default terminal when running kterm?