jmacdonald / amp

A complete text editor for your terminal.
https://amp.rs
Other
3.68k stars 105 forks source link

problems with version from master branch #146

Closed pbgc closed 5 years ago

pbgc commented 5 years ago

Hi,

Out of curiosity I built the version from master branch and tried to use it. I got some problems ... with some actions giving me [A or [B characters inserted and ESC key not functioning (hence could not leave edit mode).

This, for example, happens doing this:

I'm on macOS 10.14.4

I filed this issue to try to help! I apologize if this is a known issue and WIP ... and in that case please close the issue.

Thanks! Pedro Costa

jmacdonald commented 5 years ago

Hi Pedro!

Thanks for opening this issue. I haven't given the updated version a spin on MacOS, but amp's input model has fundamentally changed so it's entirely possible we've introduced a regression. I'll give this a go to see if I can reproduce.

jmacdonald commented 5 years ago

Ok @pbgc, using Alacritty on MacOS 10.14 doesn't expose the issue you're having. What terminal emulator are you using?

pbgc commented 5 years ago

Hi,

I'm using Alacritty 0.32 and just checked and this problem does not happen on iterm2 or macOS terminal....

Strange because I use alacritty for a long time without any problem in any app .. and use it with amp 0.52 without this one or any other problem.

pbgc commented 5 years ago

Sorry... Just saw better what you wrote and saw that you are using also alacritty.

Are you pressing the up arrow right after (not at the same time but very fast after) the esc ?

EDIT:

You have to press ESC then UP fast and then UP again ( you get [A ) or ESC then DOWN fast and then DOWN again ( you get [B )

EDIT2:

Just tested several times and this only happens to me with Alacritty .... works without problems with iterm and terminal ... so if you are using alacritty 0.32 (last release) and can't replicate ... maybe close the issue.

pbgc commented 5 years ago

@jmacdonald I finally solved this!

The problems above and several other strange things ... was being caused by the fact that there was a BIG delay on ESC key action !!!

Searching and after looking at: https://github.com/jwilm/alacritty/issues/1680 that pointed me to: https://www.johnhawthorn.com/2012/09/vi-escape-delays/

adding the line set -s escape-time 0 to my .tmux.conf file ... got all problems away!

I don't understand why this only was happening with Alacritty and not iterm2 or term ... and 0.52 worked without problem in all ... but now I'm not having any problem!

jmacdonald commented 5 years ago

@pbgc nice find! Thanks for sharing the solution, and closing this issue. :slightly_smiling_face: