s-macke / jor1k

Online OR1K Emulator running Linux
http://jor1k.com
BSD 2-Clause "Simplified" License
1.74k stars 198 forks source link

terminal broken after exiting tmux #64

Closed ysangkok closed 9 years ago

ysangkok commented 9 years ago

reproduction:

  1. launch jor1k
  2. start tmux
  3. press ctrl-d
  4. terminal broken (only one line visible, even reset or stty sane doesn't fix it)
s-macke commented 9 years ago

Yes, there is some terminal weirdness. But the terminal, which is used has no internal states, which could alter the \r \n behavior. That means, that tmux alters somehow the assumptions about the terminal. I havnt's been into the details yet. But I think, this has to do with some missing terminal features. Look at "stty -a". He doesn't tell me the rows and columns and there is even a "No such file or directory" error. I guess when I fix these errors, tmux will also work. The problem is, I don't know how. I guess I have to do some digging in the kernel code. I don't think, that another Javascript terminal fixes this behavior. But I haven't tried it.

s-macke commented 9 years ago

The "stty -a" output is identical before and after tmux.

ZaDarkSide commented 9 years ago

Try http://terminal.jcubic.pl/

s-macke commented 9 years ago

If you set "stty rows 24" before you start tmux the problem disappears. The question is how to solve it. When terminals change their size they send the new rows and columns. But do they also send the data when they initialize? What is the correct behavior? I can set the rows in the init script. But I don't like the solution, because jor1k allows other terminals with other sizes too.

s-macke commented 9 years ago

https://github.com/s-macke/jor1k/commit/87c6b044a3a5f89c25cdb28eb24879b774f11e4e Can you check if it works?

ysangkok commented 9 years ago

works great, thanks