AlecAivazis / survey

A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
MIT License
4.08k stars 350 forks source link

fix(cursor): fix terminal cursor move display #217

Closed mritd closed 5 years ago

mritd commented 5 years ago

fix terminal cursor move display

I only completed the test on my terminal (iTerm2).

2019-06-02 20 48 53

In the test I found that Goland's terminal seems to have problems with emoji:

Use the test string: 啊啊啊啊aaaa😀😀😀😀啊啊啊啊啊啊

When the cursor is in the first position of emoji, the cursor appears to be abnormally jumped when trying to delete the letter a

Signed-off-by: mritd mritd@linux.com

mritd commented 5 years ago

issue: refs #126 pr: refs #180

AlecAivazis commented 5 years ago

Thanks for re-opening this @mritd! Just to be clear, does your PR fix the issue that you are highlighting or is the issue still present?

mritd commented 5 years ago

@AlecAivazis Thank you for your reply, currently passed in the iTerm2 terminal test, some special terminals (like Goland termianl) have problems with emoji (I think this is Goland's problem)

mritd commented 5 years ago

Passed the test on the mac native terminal.

AlecAivazis commented 5 years ago

Awesome. thanks for testing it on a few different terminals. I have been a bit busy with other changes coming into survey so i haven't had a chance to look carefully yet. I did notice that you didn't touch any of the windows files - is there something that prevents the bug you fixed from affecting windows?

mritd commented 5 years ago

Sorry, due to the recent Chinese firewall (GFW), I replied later.

I think we can add a test option to enable this fix; but I tested it in windows's powershell, cmd and it looks fine 😄

Note: emoji cannot be displayed on windows

2019-06-05 22 12 02

2019-06-05 22 23 19

mritd commented 5 years ago

Unfortunately, for cygwin, survey doesn't seem to work (in case there is no fix code) 😂

mritd commented 5 years ago

@AlecAivazis Is there any progress now?

AlecAivazis commented 5 years ago

Yea i pulled it down and moved around. there was a weird behavior when deleting emojis that would cause them to hang around even after I delete the line. I haven't had a chance to dig deeper yet. Have you seen this?

mritd commented 5 years ago

Is there a way to reproduce? I have not encountered this problem.

AlecAivazis commented 5 years ago

Okay I finally got some time to go through this. Sorry it took so long! I know that can be very frustrating.

I think this is good go code wise. I'm going to do one final round of testing on my machines and then we can merge this.

AlecAivazis commented 5 years ago

@mritd I merged this and It seemed to break the windows builds. If you want to reopen it and investigate why - that would be awesome

mritd commented 5 years ago

I have given up on fixing this issue.

The issue has been going on for more than a year (issue was opened on March 7, 2018); for such a long time we are waiting for a reply...and then waiting for a reply... always

By the time we want to compile it and run it, there may be a lot of changes to the master code, and then wait for me to re-pull the code... fix the code... retest the code... re-open the PR... Next is waiting for a reply

This really doesn't make sense, isn't it?