-
Notifications
You must be signed in to change notification settings - Fork 355
Conversation
Works like a charm on my osx laptop! I'll try to pull this down and test it out tomorrow when I have access to a windows laptop. Minor point, it seems like |
Cool, I have not tried |
I just tried a few of the tests with |
Ah, seems the behavior is inconsistent. |
Okay, cool I will get this fixed. I tried |
Fixed the panic and the alignment issues on |
Just verified that the behavior is working as expected on Windows 10 for all of the tests! We're really damn close to finally putting this to rest. However, there seems to be a small issue with the output on windows - it seems like there is an extra space in the templates that causes the question to be one space to the right the first time it renders. I'll try to get a screen shot from my windows laptop but if you run |
Hey, I Just fixed the spurious space ahead of the ' ?' character. I also was annoyed about the inconsistency between |
Ughh, one more slight bump, when I use default value for Input is not writing the |
Okay, this is not a new issue, the template has:
So if the default answer is "" then it evaluates to false and the template shows the prompt again. I will try to think about a better way to test if we are supposed to print the |
I think this PR is good to go from my end. I don't have any further refactoring on it planned unless you want some changes to it. |
Whoops, forgot to mention that this PR will fix #52 |
Awesome! Thanks for fixing that so quickly. And thanks for finding that bug with |
@@ -22,8 +20,8 @@ type Question struct { | |||
// Prompt is the primary interface for the objects that can take user input | |||
// and return a string value. | |||
type Prompt interface { | |||
Prompt(*readline.Instance) (interface{}, error) | |||
Cleanup(*readline.Instance, interface{}) error | |||
Prompt() (interface{}, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is probably my favorite part of this whole PR - Thankyou so much for removing readline! While having to support individual systems like this is a bit scary, we'll handle the obscure edge cases over time. Overall this is yet another huge improvement
Okay I just checked this out on a windows machine and everything seemed to work perfectly except that |
I am confused, what behavior do you expect for |
Yea I'm still thinking about that, I guess I'm used to |
Okay, I see. Well |
Yep, I agree. Leaving it as it is is what I'm in favor of too |
Due to complications and inconsistencies with Readline (that prevent autoplay from working reliably) I have removed Readline from the codebase. For the simple cases of
Confirm
andInput
I have replaced with withbufio.Scanner
. For the cases where we need to read a rune at at time I have implementedterminal.RuneReader
with specializations for most Unix flavors along with Windows. I have tested it on Windows 10, Linux and OSX and it seems to work well.Future refactoring: