Skip to content
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

--clear not working on iterm2 #1

Closed
noc7c9 opened this issue May 22, 2021 · 5 comments
Closed

--clear not working on iterm2 #1

noc7c9 opened this issue May 22, 2021 · 5 comments

Comments

@noc7c9
Copy link

noc7c9 commented May 22, 2021

As it says --clear doesn't seem to be working at all.

watchexec 1.16.0
iterm2 3.4.6

I can also replicate on the main branch but I discovered that making the following change makes --clear work.

diff --git a/lib/src/run.rs b/lib/src/run.rs
index f1531c6..8c82b11 100644
--- a/lib/src/run.rs
+++ b/lib/src/run.rs
@@ -174,6 +174,7 @@ impl ExecHandler {
     fn spawn(&self, ops: &[PathOp]) -> Result<()> {
         if self.args.clear_screen {
             clearscreen::clear()?;
+            println!();
         }

         debug!("Launching command");

That seems super odd to me, but maybe it'll help figure out the issue.

@noc7c9
Copy link
Author

noc7c9 commented May 22, 2021

BTW, the clscli example in clearscreen also works. $ cargo run --example clscli auto

@passcod
Copy link
Member

passcod commented May 22, 2021

Oh, line bufferring, I would guess.

@passcod passcod transferred this issue from watchexec/watchexec May 22, 2021
passcod added a commit that referenced this issue May 22, 2021
May help in some cases where line buffering is preventing the
application of the clearing sequences. See #1.
@passcod
Copy link
Member

passcod commented May 22, 2021

Since you have watchexec building, could you test it when swapping in clearscreen from git? Otherwise I'll go test whenever I get on my mac next.

passcod added a commit that referenced this issue May 22, 2021
May help in some cases where line buffering is preventing the
application of the clearing sequences. See #1.
@passcod
Copy link
Member

passcod commented May 22, 2021

Actually, done. Will push out releases soon.

@passcod passcod closed this as completed May 22, 2021
passcod added a commit that referenced this issue May 22, 2021
May help in some cases where line buffering is preventing the
application of the clearing sequences. See #1.
@noc7c9
Copy link
Author

noc7c9 commented May 22, 2021

Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants