-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Respect termios ECHO
flag
#673
base: main
Are you sure you want to change the base?
Conversation
In the future, this PR might not be necessary to get Note that for now, the PR only stops the printing of the input text -- hints, menus, or history will always be shown regardless of the |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #673 +/- ##
==========================================
+ Coverage 49.19% 49.23% +0.04%
==========================================
Files 46 46
Lines 7930 7917 -13
==========================================
- Hits 3901 3898 -3
+ Misses 4029 4019 -10
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what is the best choice to test reedline's
specifc behavior with rexpect
or what conventions arose for other shells when given ~ECHO
.
For your Nushell tests in nushell/nushell#11178 having the hinter dump stuff from the history may possibly interfere.
Cargo.toml
Outdated
@@ -19,6 +19,7 @@ crossbeam = { version = "0.8.2", optional = true } | |||
crossterm = { version = "0.27.0", features = ["serde"] } | |||
fd-lock = "3.0.3" | |||
itertools = "0.10.3" | |||
nix = { version = "0.27.1", features = ["term"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not super critical but we could make this a unix only dependency for slightly faster downloads on windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, forgot to do that.
src/engine.rs
Outdated
@@ -149,6 +149,9 @@ pub struct Reedline { | |||
// Manage optional kitty protocol | |||
kitty_protocol: KittyProtocolGuard, | |||
|
|||
// Echo typed input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this an absolutely obscure usecase I think expanding this to a small doccomment with pointers what you are trying to achieve and the relation to the termios
flag makes sense for future generations.
Thankfully, I don't think this will be an issue:
This is also part of the reason why I was wondering if there was a way to disable the history for nushell or start with a blank history file.
The only example that I know off the top of my head is GNU |
This PR makes it so that the
ECHO
flag given by termios is respected. That is, the input characters are not printed/echoed back to the user if theECHO
flag is missing. This will help with usingrexpect
to testreedline
andnushell
, as the syntax highlighting, etc. does not need to be accounted for.Related to: nushell/nushell#11178