-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
REPL test output truncated in Windows 7 #474
Comments
Unfortunately I have no windows machines (real or virtual), so I can't test this myself. Is the problem present in the current 0.5 release as well? |
I found that the powershell inferior shell mode would interfere with the cider repl in a similar way and removing (require 'powershell) in my init files fixed it. Regarding ^M I use a solution based on this stackoverflow answer: http://stackoverflow.com/questions/10098925/m-character-showing-in-clojure-slime-repl/11787550#11787550 |
Have not tried in the 0.5 release - but scottdw's solutions worked perfectly, it was indeed powershell - removing that worked. Also addressed the ^M's in the same way. Thanks! |
@scottdw Maybe you should add this to the README in some section for Windows users? |
The ^M solution is a bit of kludge and I think the issue would be better addressed by setting the buffer-proccess-coding-system for cider buffers to the value returned by (.get (System/getProperties) "file.encoding") from nrepl but I'm unsure about how to go about doing that. |
Okay, looked a little deeper into the ^M issue. It looks like I was wrong about it being solvable with coding systems. The solution I've settled on is to add "-Dline.separator="\n"" to :jvm-opts of my :user profile in ~/.lein/profiles.clj. This has the happy side effect of fixing all of cider's buffers, not just the repl buffer (eg. doc buffers and server buffers). Would you like a pull for the readme file with a new section under Caveats listing these two Windows issues: truncated output and carriage returns? |
Yep, that sounds good to me. |
@scottdw Ping :-) |
Document workarounds for EOL issues in Microsoft Windows and note powershell.el conflict (Issue clojure-emacs#474).
Document workarounds for EOL issues on Microsoft Windows and note powershell.el conflict (issue clojure-emacs#474).
I believe this is a terrible idea? Changing my profiles.clj as now suggested in the Cider README now breaks lein.bat! For example, doing:
from the command line. I get the following exception:
instead of starting up a Clojure REPL. Actually, with that change I can't even run After I remove that line everything works okay. |
I have seen this occasionally but the majority of time it Works For Me. Perhaps try running I agree that it's a "terrible" workaround, unfortunately I've tried various process-coding-system / buffer-coding-system and jvm file.encoding combinations including the |
At the very least the readme needs to be changed to warn users on Windows systems of how this may break Also, at least on my system, it breaks the emacs
I tried with and without the Cider 0.5.0 |
A much better idea is to follow the advice in "Hiding ^M in emacs" [1]. Put the following in your init file: (defun remove-dos-eol ()
"Do not show ^M in files containing mixed UNIX and DOS line endings."
(interactive)
(setq buffer-display-table (make-display-table))
(aset buffer-display-table ?\^M []))
(add-hook 'cider-repl-mode-hook 'remove-dos-eol)
(add-hook 'text-mode-hook 'remove-dos-eol) ;If you are annoyed by trailing ^M in text buffers. This fixes the trailing ^M problem at least. |
Which is presented as the first option in the readme linking to a stackoverflow answer that references the above answer and describes how to add that function to the cider repl hook. |
I just re-read Caveats > Microsoft Windows paragraph of the README. It contains no reference to the possible bad consequences of setting the JVM options as described. Probably because I was reading it so fast, I completely missed the "correct" option (and the fact that the fix isn't spelled out but "hidden" inside a "here" link). [I even had to edit this response because I missed it during my 2nd & 3rd re-reads] I repeat. The README should be changed to mention the caveats to the alternative solution. And perhaps the first fix should be spelled out explicitly, with a link to where the fix originated. |
See the discussion here. It'd be great if a Windows user tested the two ideas suggested by Eli (who's an Emacs legend). |
I tried Eli's suggestions the other day but haven't had a chance to write up the results. By changing the process output to
|
Thanks for the info, @scottdw! I guess we're back to the drawing board regarding this. |
Using Windows 7, when running tests in the REPL, the output will get truncated to only display the first line of output - e.g:
(another observation is the fact that the ^M's will always appear in the output).
Strangely enough, the FIRST time you run a test in a fresh cider REPL, it does NOT truncate the output.
This also has the unfortunate result of not allowing clojure-test-run-tests to work properly.
The text was updated successfully, but these errors were encountered: