randy3k / Terminus

Bring a real terminal to Sublime Text
https://packagecontrol.io/packages/Terminus
MIT License
1.39k stars 81 forks source link

Sent, Received, and detected characters differs #207

Open gragusa opened 4 years ago

gragusa commented 4 years ago

I have been experiencing double typing when using Terminus on Linux (Terminus: 0.3.13 - Sublime Text build 3211). When typing on a Terminus shell I get repeated character. This is the output from the debug:

add 0 line(s) to scroll back history
screen is dirty: [1, 2]
updating lines takes 0.017820358276367188s
mode: [7, 25], cursor: 2.2
text s detected
sent: s
receieved: s
add 0 line(s) to scroll back history
screen is dirty: [2]
updating lines takes 0.0029058456420898438s
mode: [7, 25], cursor: 3.2
text s detected
sent: s
receieved: s
add 0 line(s) to scroll back history
screen is dirty: [2]
updating lines takes 0.0031354427337646484s
mode: [7, 25], cursor: 4.2
sent: x
receieved: x
add 0 line(s) to scroll back history
screen is dirty: [2]
updating lines takes 0.0027680397033691406s
mode: [7, 25], cursor: 5.2
text s detected
sent: s
receieved: s
add 0 line(s) to scroll back history
screen is dirty: [2]
updating lines takes 0.0029685497283935547s
mode: [7, 25], cursor: 6.2
sent: s
text s detected
sent: s
receieved: ss
add 0 line(s) to scroll back history
screen is dirty: [2]
updating lines takes 0.003149271011352539s
mode: [7, 25], cursor: 8.2
set recent view: 50
set recent view: 50

It seems that at a certain point although s is sent ss is received. I looked in the code, but I could not see anything wrong.

randy3k commented 4 years ago

It seems that you have a keybinding bind to s? It’s showing text detected, it is a sign that a fallback mechanism was used to detect changes. Normally, it should not be triggered unless you are typing special characters such as European or CJK chars.

randy3k commented 4 years ago

It is my log when typing s.

updating lines takes 0.0013301372528076172s
mode: [7, 25], cursor: 20.2
sent: s
receieved: s
add 0 line(s) to scroll back history
screen is dirty: [2]
chrishalebarnes commented 4 years ago

I've also had this happening for quite some time now. It did not used to happen before an update, but I'm not sure which update that was.

Some interesting findings: If I copy and paste the keybindings from Default.sublime-keymap into my own Default.sublime-keymap then it stops doing this double echo. So that'll do as a workaround. If you're trying to reproduce this, make sure you do so without any user keymap. Perhaps also test with a user keymap with one unrelated binding as well. I'm not totally sure why that's doing anything, because it should be the same thing

Lastly, this is not an issue on Debian for me with roughly the same configuration, only on OSX.

Hope something in there helps narrow this down

rchl commented 4 years ago

If I copy and paste the keybindings from Default.sublime-keymap into my own Default.sublime-keymap then it stops doing this double echo. So that'll do as a workaround.

That will override potential bindings from external packages. So you likely have some package installed that causes this behavior.