rustyline icon indicating copy to clipboard operation
rustyline copied to clipboard

Constrained box readline support

Open WalterSmuts opened this issue 3 years ago • 3 comments

This is a feature suggestion which I'm happy to help work on.

I'm interested in using the tui-rs library combined with the functionality of rustyline, specifically the vi editing mode. This would require constraining the the readline function's domain of operation to a specific box on the screen, considering this box as it's area it can edit.

Currently the default behavior of rustyline is to assume it has control over the entire terminal, and would insert a new line and start at the left-most edge when printing a prompt. Having the bounding box configurable would allow developers to compose rustyline as a widget of the tui-rs library.

Would you be interested in accepting such a feature in your library?

Any suggestions or concerns?

WalterSmuts avatar Jul 04 '21 17:07 WalterSmuts

Do you know any readline-like library (in any language) which supports such feature ? Except for the clear_screen command, you may just need to fake the size of the screen if rustyline is kept on the left-most side. Also, see #494. And if size is small, there is no scroll support (see #378).

gwenn avatar Jul 04 '21 19:07 gwenn

Do you know any readline-like library (in any language) which supports such feature ?

Nope. Looked around a bit and couldn't find anything.

Except for the clear_screen command, you may just need to fake the size of the screen if rustyline is kept on the left-most side.

I was hoping we could have any arbitrary bounding box, not just be constrained to the left-most side.

Also, see #494.

Thanks! Looks like others are looking for the same functionality. Asked there to see if the folks have the same idea.

WalterSmuts avatar Jul 05 '21 19:07 WalterSmuts

I would like this functionality too :>

peepo5 avatar Apr 22 '22 23:04 peepo5