-
Notifications
You must be signed in to change notification settings - Fork 44
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
no correct information about terminal width/height available #75
Comments
Cool, I like that project idea. Unfortunately, I think it's a very low-level thing that I'm not following at the moment: even JRuby doesn't handle this transparently for me locally:
On my local setup, I found that I was able to get ahold of this info, but I had to Interestingly, we use
I can imagine a hack where we export It's really too bad that support isn't better, but I must say I'm baffled as to how JLine2 can possibly be getting away with this! Even calling its APIs through a Clojure repl seems to work, so if you're willing to explicitly depend on jline2, you could get away with using it directly:
Hopefully that helps. But it certainly seems to be an upstream issue of one sort or another, so I'll close this. Would still definitely like to hear what you settle on. |
Thanks for pointing me in the direction of jline! I looked around and found this which allowed me to construct this: user=> (->> (clojure.java.shell/sh "/bin/sh" "-c" "stty -a < /dev/tty") :out (re-find #"(\d+) columns") second)
"238" As for the $COLUMNS dilemma, it seems that's a java-specific issue as mentioned here. I've confirmed this for ruby as mri ruby gives me ENV["COLUMNS"] fine while jruby doesn't. As for other lein contexts that work with $COLUMNS, I was wrong. I had checked that in a shell where I had already exported COLUMNS. |
Also, thanks for your hard work on reply. Having autocompletion and clojuredocs have been helpful :) |
Cool, glad to hear it! |
This is the solution that works on my machine (Mac OS X Snow Leopard) [re-jiggered the regex]:
|
Hi,
I'm writing a clojar that needs to detect a user's terminal width. I've tried all the following ways which work fine in a ruby repl but none of them work in reply:
$COLUMNS not being picked up is particularly strange since other lein tasks do pick it up. Any pointers on where/how I could patch this up in reply?
The text was updated successfully, but these errors were encountered: