aprint icon indicating copy to clipboard operation
aprint copied to clipboard

OSX terminal broken after closing REPL

Open maurolopes opened this issue 9 years ago • 13 comments

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!

maurolopes avatar Sep 16 '14 14:09 maurolopes

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

razum2um avatar Sep 16 '14 14:09 razum2um

Redirecting (ap 1) to a file gives me:

^[[34m1^[[0m

Does it help?

maurolopes avatar Sep 16 '14 15:09 maurolopes

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.

razum2um avatar Sep 16 '14 15:09 razum2um

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.

maurolopes avatar Sep 16 '14 15:09 maurolopes

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

razum2um avatar Sep 16 '14 15:09 razum2um

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.

maurolopes avatar Sep 16 '14 17:09 maurolopes

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

razum2um avatar Sep 16 '14 18:09 razum2um

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!

maurolopes avatar Sep 16 '14 20:09 maurolopes

@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

razum2um avatar Sep 28 '14 14:09 razum2um

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.

bluealert avatar Sep 28 '14 14:09 bluealert

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

razum2um avatar Sep 28 '14 14:09 razum2um

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).

venantius avatar Jan 01 '15 06:01 venantius

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

tiye avatar Nov 21 '15 08:11 tiye