reactphp-stdio icon indicating copy to clipboard operation
reactphp-stdio copied to clipboard

Readline does not cope well with long prompt inputs

Open clue opened this issue 11 years ago • 5 comments

clue avatar Sep 09 '14 23:09 clue

We can probably use control codes (VT100 anybody?) to get the current terminal size and limit our user input line to the maximum width available. This is non-trivial, but certainly doable. Any other thoughts?

clue avatar May 18 '15 20:05 clue

we can use intval(getenv('COLUMNS')), but i don't think that limiting user input length is the right answer. Maybe something like nano scrolling line is the way

naive17 avatar Sep 16 '19 09:09 naive17

@koso00 Thanks for you input, I agree relying on COLUMNS could be a starting point, but this doesn't completely solve this problem. For instance, we also need to take care of resize events, so I've just filed #92 to keep track of this underlying feature.

Once we know the terminal size, we can limit and/or wrap the user input line.

clue avatar Sep 24 '19 17:09 clue

Actually i forked the project, you can see i added mouse events and i'm planning to add resize with the same "way". you can watch yourself

naive17 avatar Sep 25 '19 07:09 naive17

@koso00 Awesome, looking forward to seeing your changes, let's continue this discussion in the dedicated feature tickets #82 and #92.

clue avatar Sep 25 '19 09:09 clue