hoaproject / Console

The Hoa\Console library.
https://hoa-project.net/
366 stars 32 forks source link

Max length input / Max value to display #18

Open Esysteme opened 10 years ago

Esysteme commented 10 years ago

It should be nice to add a max value of input :

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/2117273-max-length-input-max-value-to-display?utm_campaign=plugin&utm_content=tracker%2F459935&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F459935&utm_medium=issues&utm_source=github).
Hywan commented 10 years ago

(Previouly created at https://github.com/hoaproject/Registry/issues/3).

Hello :-),

Could you give us a use case for such a feature?

Hywan commented 10 years ago

/cc @jubianchi

Esysteme commented 10 years ago

@jubianchi

the goal is to make CLI intervace as :

The goal is the text have to stay in input and don't break the windows.

In second time save the bottom and put it back after we try autocomplete. (nice to have)

Hywan commented 10 years ago

I think that this is not part of Hoa\Console\Readline to support an “input”. But having a max length does not sound bad. Do we print an error when the “end of the line” is reached?

Esysteme commented 10 years ago

I think just better to block as html when max reached

Hywan commented 10 years ago

To implement correectly this feature, we need to detect if a character is printable or not. Consequently, this is related to https://github.com/hoaproject/Console/issues/16#issuecomment-43053055.