cosmos72 / twin

Text mode window environment. A "retro" program for embedded or remote systems, that doubles as X11 terminal and text-mode equivalent of VNC server
Other
667 stars 39 forks source link

twin running inside Linux console => corrupted text #8

Closed cosmos72 closed 1 year ago

cosmos72 commented 8 years ago

This was reported by Mirppc in issue #4: "Problem in my case isnt SSH. If i boot to runlevel 3 or init 3 i get the issues with Twin. This isnt an SSH issue as i am not using xterm. i am in a TTY session locally."

This is unexpected. As I wrote in issue #4, I need the following to troubleshoot the problem:

cosmos72 commented 8 years ago

any news on the screenshots (or camera picture of the screen) I asked to analyze the problem?

rodneyrod commented 7 years ago

I've been having the same problem trying to SSH into my remote server.

When it loads, I get this screen: http://imgur.com/a/W0n1Y

When I close the terminal window in Twin, I get this screen: http://imgur.com/a/i5sZh

Mirppc commented 7 years ago

wow... glad i am not the only one.

So thanks rodneyrod. you got me off my duff.

http://paste.opensuse.org/74827439 here is Twin via SSH

http://paste.opensuse.org/46188035 what the command should look like.

Though i must say the coloring in the logo was much better in TWIN, the output was horrible. The only way i was able to exit was by sure sheer luck and experience with a working TWIN using X.

cosmos72 commented 7 years ago

Thanks for the screenshots, I think I know what's the problem now :) I will test a fix ASAP

Mirppc commented 7 years ago

so i am ssh'ed into my chip. I compiled twin on it and it doesnt seem to like the MacOS terminal i am using, either that it it doesnt like running in byobu.

http://imgur.com/a/TptsK

Tested earlier today on my Opensuse 42.2 via a TTY session (alt-ctrl-F2) and the only thing broken was GPM. Will talk to the maintainer of the package about that as it is one of the things that has plagued me during compiling.

Update on the chip: Had to kill that terminal tab and then ssh back into the machine killing both byobu and twin. it crashed. no mouse support.

Mirppc commented 7 years ago

Update: cant sleep... only dream in TWIN

So i thought i would take a crash course and update my local twin code. after a git pull i recompiled and...

http://paste.opensuse.org/28520556 fudgsicles and lollipops. That didnt work, least i got the mouse working. Might be because i was not in Byobu this time.

Could this be a separate issue possibly (O_o?) I dont want to overload poor cosmo72 as he is doing some magnificent work. If i only knew more programing at that level. Thus i wont bother bug reporting the byobu/tmux issue until later. This garbleness i belive is a much more pressing bug.

cosmos72 commented 7 years ago

Fix available, see commit ca4b6fec623731ba612a85952b75024f66d3a645 :)

Running on untested terminals should work much better now, at the price of ASCII-only output by default. You can override this behaviour (and risk garbled output) with the options --hw=tty,utf8 or --hw=tty,charset=NAME

I had the feeling you (Mirppc and rodneyrod) were both using some terminal that I never tested... it seems I was at least partially right, since you wrote about running twin inside:

cosmos72 commented 7 years ago

By the way, you could always run twin inside another twin... it works perfectly in basically every combination (including mouse support), as for example:

1) on Mac OS X, compile, install & start twin 2) inside this "first" twin, open a terminal and run ssh to your remote server (no need for X11 forwarding, i.e. ssh -X) 3) log in, and start twin (a "second" one) in the remote server

P.S. if you use "Common -> UnFocus" followed by "File -> Detach" instead of quitting twin, and use "twstart" instead of "twin" to reattach to a running twin server, usually you don't need any other terminal multiplexer (screen, tmux, byobu...) :)

Mirppc commented 7 years ago

Byobu is Tmux with some additional pretty things. i am ssh'd in using iterm or whatever it is called on Mac OS. I should be smarter and no use byobu and twin with each other as i am hoping to get twin to replace byobu for me :).

http://byobu.co/

Mirppc commented 7 years ago

Update:

Recompiled on the chip with the latest and though there still is some garbage it functions a little better.

http://paste.opensuse.org/71481528

Edit: menus are not working. they can drop but nothing is selected.

rodneyrod commented 7 years ago

@cosmos72 Using the Secure Shell addon in Chromium, but I also have the same issue in the default OSX terminal.

Funny enough, I can't get it working in iTerm2 or FireSSH in Firefox, both of them fail with twin unable to find any displays to render to, complaining that

tty_InitHW() failed: unable to read from the terminal: read() from tty timed out

No idea why that issue is being caused but I have alternative shells I can use so it's a very low priority for me personally.

rodneyrod commented 7 years ago

Confirmed this fixes the issue on Secure Shell.

cosmos72 commented 7 years ago

If you use twin inside an xterm or xterm-like (Mac OS X iTerm, gnome-terminal, xfce4-terminal, konsole, xterm, Google Chrome/Chromium + Secure Shell...) then commit 0edbc023f2a0fab88b69675ef6bcd6c3a7e0684e should greatly improve mouse support :)

I also tried FireSSH, and it misses two important features in order to run twin inside it:

If you are interested in it, you may want to consider opening a bug report (actually an enhancement request) to FireSSH developers with these two items

RealSuperRyn commented 1 year ago

This may or may not be related, and I'm certainly very late over here, but here's a bugged Neofetch output twinshot

cosmos72 commented 1 year ago

@RealSuperRyn that looks like a tty configuration mismatch, i.e. twin terminal and the program running inside it (Neofetch) seem to disagree on some terminal-related flag - for example one thinks UTF-8 is enabled, while the other thinks UTF-8 is disabled.

Can you post a screenshot of the expected Neofetch output, by running it inside a different terminal emulator? That would help understanding what's wrong. Thanks

cosmos72 commented 1 year ago

Update: I installed an started Neofetch: the problem is it configures the terminal in some very strange way - shell output, including prompt, is completely garbled. It's so strange that I did yet not find a way to restore the terminal to a working condition.

cosmos72 commented 1 year ago

Update 2: fixed in commit 2bacd1fc6e89a8d73c54e3ea0192c1cbb39a0f19 The issue was twin terminals misinterpreted escape sequences to set 8-bit and 24-bit colors.