Checking terminal capabilities on each operation #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi again. This is a more controversial change than my previous one as it removes the capability check during initialization. When a terminal tries to perform some function, it only sends the relevant sequence if the terminal actually has that capability. The result is this library now works on more terminals (I specifically made this change because the library didn't work on urxvt due to a lack of "cnorm"). I tested it on urxvt/gnome-terminal and it appears to work fine, though I guess it's possible to run the library on an incompatible terminal and have it produce garbled output where previously it would have bailed out during init. Let me know what you think.
This removes the check performed during driver initialization that
ensures the terminal supports all the required capabilities. Driver::get
now returns an Option<_> which is Some("escape sequence") if the
terminal has the requested functionality, and None otherwise.