twin icon indicating copy to clipboard operation
twin copied to clipboard

twin running inside Linux console => corrupted text

Open cosmos72 opened this issue 8 years ago • 13 comments

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:

  • a screenshot or (simpler) a picture of the screen showing the issue
  • the font name being used in the Linux console

cosmos72 avatar Jul 15 '16 12:07 cosmos72

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

cosmos72 avatar Nov 26 '16 17:11 cosmos72

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

rodneyrod avatar Dec 17 '16 04:12 rodneyrod

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.

Mirppc avatar Dec 17 '16 08:12 Mirppc

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

cosmos72 avatar Dec 17 '16 17:12 cosmos72

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 avatar Dec 18 '16 10:12 Mirppc

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.

Mirppc avatar Dec 18 '16 10:12 Mirppc

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:

  • byobu (never heard about it)
  • tmux (I know it, but never tried twin inside it)
  • MacOS terminal (tested twin inside it only once some days ago)

cosmos72 avatar Dec 18 '16 21:12 cosmos72

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...) :)

cosmos72 avatar Dec 18 '16 22:12 cosmos72

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 avatar Dec 18 '16 22:12 Mirppc

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.

Mirppc avatar Dec 18 '16 23:12 Mirppc

@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 avatar Dec 19 '16 02:12 rodneyrod

Confirmed this fixes the issue on Secure Shell.

rodneyrod avatar Dec 19 '16 02:12 rodneyrod

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:

  • no support for terminal identification (ESC Z or ESC [ c) - this is what causes the error "read() from tty timed out"
  • no support for xterm-style mouse reporting (ESC [ ? 1000 h or ESC [ ? 1002 h) - i.e. mouse not available to applications

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

cosmos72 avatar Dec 19 '16 20:12 cosmos72

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

RealSuperRyn avatar Jul 29 '23 03:07 RealSuperRyn

@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 avatar Jul 29 '23 08:07 cosmos72

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 avatar Jul 29 '23 08:07 cosmos72

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

cosmos72 avatar Jul 29 '23 09:07 cosmos72