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

Corrupted terminal #30

Closed
wojtha opened this issue Oct 9, 2016 · 1 comment
Closed

Corrupted terminal #30

wojtha opened this issue Oct 9, 2016 · 1 comment

Comments

@wojtha
Copy link

wojtha commented Oct 9, 2016

I've found that rubocop-guard is breaking my ZSH terminal (but it is happening in Bash as well), especially after some error was printed to STDOUT. I had to exit from guard and run stty sane to reset the terminal every time when this happen. This issue is bothering me for 2 months, but I was suspecting guard-rspec which I am using as well.

After some research I knew that is some ANSI escaping issue and that it is happening somewhere around Guard::UI or Guard::Compat::UI. Today I first tried to disable the guard-rubocop and the problem went away, then I discovered the PR #19 which promotes upgrade to "new" Guard::Compat API and I give it a try. When I applied patch in #19 the problem went away as well.

Before patch:

1 fsevent_watch 2016-10-09 01-38-00

guard-rubocop (1.2.0)
guard (> 2.0)
rubocop (
> 0.20)

After patch:

1 fsevent_watch 2016-10-09 01-39-17

guard-rubocop (1.2.0-patched)
guard (> 2.0)
guard-compat (
> 1.1)
rubocop (~> 0.20)

System info

$ uname -a
Darwin Kernel Version 15.6.0: Mon Aug 29 20:21:34 PDT 2016; root:xnu-3248.60.11~1/RELEASE_X86_64 x86_64
$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
$ zsh --version
zsh --version
zsh 5.2 (x86_64-apple-darwin15.4.0)
@wojtha
Copy link
Author

wojtha commented Dec 15, 2016

This was maybe just an accident. After a while the issue returned and happen again on regular basis again even with the PR #19.

I have tried various things since then, it seems that it is kind of readline/zeus/guard/macOS issue. See e.g. https://github.com/guard/guard/wiki/Add-Readline-support-to-Ruby-on-Mac-OS-X

The simplest way is just add gem rb-readline to your development Gemfile. I've encountered several situations in past hours which I am sure would end up with corrupted terminal, but with rb-readline it works ok.

@wojtha wojtha closed this as completed Dec 15, 2016
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

1 participant