LibLine: Check if operating on a TTY before using TTY features

This makes the line editor behave well when input is passed in from
pipes as well.
This commit is contained in:
AnotherTest 2020-08-05 09:58:47 +04:30 committed by Andreas Kling
commit 70eb7aa627
Notes: sideshowbarker 2024-07-19 04:15:58 +09:00
2 changed files with 36 additions and 13 deletions

View file

@ -61,8 +61,10 @@ struct Configuration {
Eager,
};
enum OperationMode {
Unset,
Full,
NoEscapeSequences,
NonInteractive,
};
Configuration()
@ -82,7 +84,7 @@ struct Configuration {
RefreshBehaviour refresh_behaviour { RefreshBehaviour::Lazy };
TokenSplitMechanism split_mechanism { TokenSplitMechanism::Spaces };
OperationMode operation_mode { OperationMode::Full };
OperationMode operation_mode { OperationMode::Unset };
};
class Editor : public Core::Object {