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

OSX terminal broken after closing REPL #2

Open
maurolopes opened this issue Sep 16, 2014 · 13 comments
Open

OSX terminal broken after closing REPL #2

maurolopes opened this issue Sep 16, 2014 · 13 comments

Comments

@maurolopes
Copy link

If I open the REPL and run aprint on any collection and then close the REPL, my terminal no longer works properly. It does not show the text I type in. The command-line is invisible, though the output of those commands are visible. Do you know what may cause this behavior? I am running it on MacOS X (the problem occurs in both Terminal and iTerm2). Other than that aprint works great!

Thanks!

@razum2um
Copy link
Owner

Maybe some escape-chars aren't "closed" normally or some output is already colored and stripped...
Try to execute (aprint 1) for example.

Please, provide sample data (better if it will be a file, not copypaste) and screenshot.

You also can switch off the color temporally as it's mentioned in readme

@maurolopes
Copy link
Author

Redirecting (ap 1) to a file gives me:

^[[34m1^[[0m

Does it help?

@razum2um
Copy link
Owner

Nope. it's correct ^[[0m is the code to reset color in terminal. it could help if you're not seeing anything. It should terminate any colored string just like a bracket.

I asked for the case to reproduce the problem.

@maurolopes
Copy link
Author

Also, it may be helpful to know that the problem occurs only after I close the REPL. If I run cat myfile (where myfile is where I redirected aprint output) it works fine, printing a colored 1 and keeping my terminal working properly. If I do lein run -m my-func, this also prints a colored 1 and keeps my terminal working properly. So the problem is only after running in the REPL.

@razum2um
Copy link
Owner

Can you please provide a sample application that reproduces the error?

@maurolopes
Copy link
Author

Sure. It is very simple:

$ cat src/my_test/core.clj
(ns my-test.core
  (:require [aprint.core]))
(defn my-aprint []
  (aprint.core/aprint 123))
$ lein run -m my-test.core/my-aprint
123
------> at this point everything still works fine
$ lein repl
user=> (require 'my-test.core)
nil
user=> (my-test.core/my-aprint)
123
nil
user=> Bye for now!
------> at this point, everything I type in the terminal is invisible

I have tested it on Linux now and it works perfectly. It seems to be some incompatibility with Mac OS.

@razum2um
Copy link
Owner

I think you should check your terminal settings, its colorscheme and probably, shell...

I cannot reproroduce your issue on mac10.9
in iterm2 (my default) - http://take.ms/J4T61
in terminal with my zsh config - http://take.ms/ZHapn
in default terminal with default bash - http://take.ms/oXw7m

You can also try to setup environment like mine if you like :)
i use https://github.com/skwp/dotfiles with some clojurish vim plugins

@maurolopes
Copy link
Author

I have tried in Terminal and iTerm2 in two computers here and both have this problem. Unfortunately I did not find any settings that could solve this. I will tell you if I discover anything new. Thanks for your efforts!

@razum2um
Copy link
Owner

@maurolopes if you like, you can setup a vm image and send it to me.
osx works in parallels and afaik in virtualbox too, but I understand it's not as easy as for linux distro

@bluealert
Copy link

Last login: Sun Sep 28 22:30:20 on ttys005
192:test tao$ lein repl
nREPL server started on port 60609 on host 127.0.0.1 - nrepl://127.0.0.1:60609
REPL-y 0.3.1
Clojure 1.6.0
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e

test.core=> (use 'aprint.core)
nil
test.core=> (aprint {:I ["heard" {:you "like"} {:nifty "tools"} {:very "muuuuuuuuuuuuuuuuuuuch"}], :so ["I" 'made '("something" 4 "you")]})
{:I ["heard"
{:you "like"}
{:nifty "tools"}
{:very "muuuuuuuuuuuuuuuuuuuch"}],
:so ["I" made ("something" 4 "you")]}
nil
test.core=> Bye for now!
192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$ 192:test tao$

OS: OS X 10.9.5

Terminal: Version 2.4 (326) Copyright © 1991-2013 Apple Inc. All rights reserved.

I use the example in your project’s README.md. You can see, I only used aprint.

@razum2um
Copy link
Owner

strange.. feel like I need a fresh virtual osx installation and will give it a try there, will inform you about progress

@razum2um razum2um changed the title Invisible text in terminal after closing REPL OSX terminal corrupted after closing REPL Sep 28, 2014
@razum2um razum2um changed the title OSX terminal corrupted after closing REPL OSX terminal broken after closing REPL Sep 28, 2014
@venantius
Copy link

I am also experiencing this issue. On OS X Yosemite (10.10.1); iTerm2 Build 2.0.0.20141103. For me the behavior was specifically triggered after making an aprint function call; the require for aprint.core doesn't introduce any problems, nor does the dependency being present (obvz).

@tiye
Copy link

tiye commented Nov 21, 2015

I also ran into this when I repeated calling read-line and aprint to build my own REPL.

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

5 participants