Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANSI not properly supported #34

Open
szopin opened this issue Apr 30, 2014 · 18 comments
Open

ANSI not properly supported #34

szopin opened this issue Apr 30, 2014 · 18 comments

Comments

@szopin
Copy link

szopin commented Apr 30, 2014

Noticed with Silica build, when you start mc (midnight commander) there are lots of:
[D] Terminal::ansiSequence:907 - unhandled ansi sequence 'X' (31) ""
messages. I believe this is responsible for the black fills after filenames in landscape (after starting in portrait got only 6 of those, in portrait only few black boxes, turn sideways and a ton showed up), probably also connected to the bugged refreshing in mc

@urjaman
Copy link
Contributor

urjaman commented Dec 31, 2014

some ANSI fixes:

urjaman@1e38821
urjaman@3d2fbe6
urjaman@9322ed4

I cant really figure out how to make a pull request for just those commits, since thats a quite different fork and that my branch is a little messy now with me trying to figure stuff out while using github to transfer changes - but those 3 should be cherry-pickable here.

@ursg
Copy link

ursg commented Dec 31, 2014

Alternatively, here's a terminfo file that seems to work more correctly with fingerterm (by not specifying a ech code, otherwise identical to xterm): http://urs.nerd2nerd.org/fingerterm.ti

@szopin
Copy link
Author

szopin commented Jul 14, 2015

@ursg fix works when first running mc, but as soon as you enter view/edit mode black blocks are back :(

@szopin
Copy link
Author

szopin commented Jul 14, 2015

@urjaman same issue here (love the colour scheme btw), but edit/view and it's all borked again

@ursg
Copy link

ursg commented Jul 14, 2015

@szopin might be that there's some other control code improperly implemented then, that I don't encounter in my daily life. Can you try to find out which one it is, then I'd update the terminfo file.

@urjaman
Copy link
Contributor

urjaman commented Jul 14, 2015

Hint: you can run the terminal from within the terminal (kinda meta), and make the issue
appear on the second terminal. Then there should/could be a debug message about the code that was not understood printed on the first one.

@szopin
Copy link
Author

szopin commented Jul 14, 2015

Running thumbterm compi9led on device from fingerterm as soon as mc starts:
[D] Terminal::ansiSequence:985 - unhandled ansi sequence 'h' (2004) "?"
Going into 'view' mode, no errors show up (but already blackness after each line)
Exiting, still no new errors. Running fingerterm from thumbterm, as soon as mc starts:
[D] Terminal::ansiSequence:931 - unhandled ansi sequence 'h' (2004) "?"
Same as before, going into view, full of black blocks, but no further errors

(also previously somehow managed to generate same error with one difference 'l' instead of 'h', same 2004, same 985 (another popped up with 3 terms running now))

Yeah, both errors show one after the other (after playing a bit, going view, then edit, ctrl-o, back, turning screen), but unlike in first case where amount of black blocks was correlated with the number of errors, now it is just a single one once in a while (playing for 2 minutes got only h-l-h)

edit3: Just for clarification, both terms were running with TERM=fingerterm, as soon as I change to xterm, the number of errors grows rapidly and the numbers differ, with fingerterm all is 2004 (btw, guys, thank you so much for your help!)

@Ape
Copy link

Ape commented Jul 14, 2015

Is it possible to get these fixes without using the custom terminfo? It's not realistically available on all the remote hosts I'm using with SSH etc.

@szopin
Copy link
Author

szopin commented Jul 15, 2015

Do you have problems on ssh? SSH from my PC to my phone and in term(putty) all is pretty and no problems at all, all the problems are only on phone. What are you using? (especially since through SSH it's your ssh client that does rendering, not sure where fingerterm comes in)

@ursg
Copy link

ursg commented Jul 15, 2015

@szopin: I tried removing the h control codes, but i don't have the impression that it helped with mc... if you want to try yourself: http://urs.nerd2nerd.org/fingerterm_no_h.ti

@szopin
Copy link
Author

szopin commented Jul 15, 2015

@ursg Thanks, got an error:
[root@Jolla terminfo]# tic fingerterm.ti
"fingerterm.ti", line 2, terminal 'fingerterm': exit_ca_mode but no enter_ca_mode
"fingerterm.ti", line 2, terminal 'fingerterm': exit_insert_mode but no enter_insert_mode
"fingerterm.ti", line 2, terminal 'fingerterm': exit_am_mode but no enter_am_mode
[root@Jolla terminfo]#
then arrows wouldn't work in mc as root (same rendering problems in view mode), as user arrows worked but the top row was rendered weirdly (black bckg), view mode also with blackness

@Ape
Copy link

Ape commented Jul 16, 2015

@szopin: If I set TERM to fingerterm on FingerTerm/settings.ini, it works quite fine on the device, but when I start for example htop on an ssh session at a remote machine I only get Error opening terminal: fingerterm.. I don't have the terminfo file available on the remote machine.

@szopin
Copy link
Author

szopin commented Jul 16, 2015

@Ape ahhh, I get it now, for a quick and dirty fix, you could copy /usr/share/terminfo/f/fingerterm file to /usr/share/terminfo/x/xterm with TERM set as xterm (just make a backup of the original), this way you should be using proper ANSI handling on device and the host will think you have normal xterm

@ursg
Copy link

ursg commented Jul 16, 2015

The easier (and probably intended) way of doing this is simply to copy fingerterm.ti to the target system and run "tic fingerterm.ti" there.
It then inserts it into your user's local terminfo database (in ~/.terminfo)

@Ape
Copy link

Ape commented Jul 16, 2015

Is there any hope for having full support for some standard terminfo on FingerTerm? E.g. xterm, rxvt, etc.

@ursg
Copy link

ursg commented Jul 16, 2015

@Ape well, the only difference between xterm termininfo file and the one I built is the erase-line-at-cursor code (ech). @urjaman's fix adds exactly that one. So if you manage to incorporate the fix, it should work nicely with xterm.

Ape added a commit to Ape/fingerterm that referenced this issue Jul 16, 2015
Cherry-picked commits provided by urjaman.

Fixes nemomobile#34.
@Ape
Copy link

Ape commented Jul 16, 2015

Thanks. The commits could be cherry-picked without conflicts and they do fix the issues.

@szopin
Copy link
Author

szopin commented Jul 17, 2015

Not really sure how deep the fixes go, but on frozen depths (roguelike), thumbterm works perfectly while fingerterm has issues with rendering every now and then, even with fingerterm.ti

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants