Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Disable fancy jline features when TERM=dumb #67

technomancy opened this Issue Jun 4, 2012 · 18 comments


None yet
3 participants

technomancy commented Jun 4, 2012

As per the discussion on the leiningen mailing list.


trptcolin commented Jun 4, 2012

Thanks for following up & creating this. Should be pretty straightforward to do in jline.


technomancy commented Jun 15, 2012

We're looking at cutting a release next week, any chance this could make it in?


trptcolin commented Jun 15, 2012


trptcolin added a commit that referenced this issue Jun 17, 2012


trptcolin commented Jun 17, 2012

I have a couple of pull requests in to jline for this:

While we're waiting on that, I'm handling the first one in REPLy (w/ the patch above).

But for the second one we'll have to either (a) wait for another jline release, or (b) go back to depending on a custom build of jline. I'm kind of inclined to leave this waiting for a jline release - there's not that much value-add in REPLy in a dumb terminal, and the exit/quit commands do still work.

What do you think?


technomancy commented Jun 18, 2012

We can wait on b for preview7 as long as it's in by the time we're ready for a final release.


trptcolin commented Jun 20, 2012

Cool. Pushed into an 0.1.0-beta9 release.


technomancy commented Jun 22, 2012

Running bin/reply.sh on master and beta9 with TERM=dumb inside eshell currently results in all output getting printed and immediately deleted.

You end up with something like this: user=> user=> user=>user=> user=>

technomancy added a commit to technomancy/leiningen that referenced this issue Jun 22, 2012


trptcolin commented Jun 22, 2012

Ugh. I guess there's more jline work to be done here for TERM=dumb. I'll try and look into it deeper.

trptcolin added a commit that referenced this issue Jul 24, 2012

Move to my jline fork
While we're waiting for release, this takes care of #67

technomancy commented Jul 27, 2012

Using the current master now I get the extra ansi codes emitted but the issue where all output was deleted is gone. Is there anything I can help with for TERM=dumb support?


trptcolin commented Jul 27, 2012

Which emacs shell do you see the ansi codes with? None of my M-x eshell, M-x term, and M-x shell seem to emit those codes - I wonder what's different between our setups. :(

jimm commented Jul 28, 2012

I see the escape codes when I run

(inferior-lisp "lein repl")

trptcolin commented Jul 29, 2012

@jimm yes, lein repl isn't yet hooked up to this latest jline stuff that I did.

@technomancy I realized that can get some ansi codes to show up in M-x shell, but only before the program launches - they stop printing once reply has control. Example: given a file bin/foo.sh that has only a shebang line and echo hi there, I see this in M-x shell:

colin:reply/ (master✗) $ bin/foo.sh 
^[]2;bin/foo.sh^G^[]1;bin/foo.sh^Ghi there

But no more once a program has started (reply included). One further debugging option to narrow it down (this is almost certainly a jline issue) would be to pull down the latest jline code run mvn package, and then in whatever terminal is seeing issues, do this:

java -cp target/jline-2.8-SNAPSHOT-tests.jar:target/jline-2.8-SNAPSHOT.jar jline.example.Example none

That should be the same stuff as on my master-based jline release that's on clojars.


technomancy commented Jul 31, 2012

My bad, I was doing lein install and then pulling it in via bumping Leiningen's project.clj rather than running the included bin/reply.sh script. Using the latter I don't see any escape codes. I don't understand why Leiningen isn't picking up the fixed version, but the fix does appear to be working in reply itself.


trptcolin commented Jul 31, 2012

Oh good. In that case I think I'm pretty close to being release-ready. Just a cpu-intensive bug that's hopefully the already-fixed leak, and the project-specific history that I think's done.

jimm commented Jul 31, 2012

So what command should I be using for an emacs inferior-lisp shell then? Not "lein repl"?


trptcolin commented Jul 31, 2012

@jimm I'm sure @technomancy could offer better advice than me on the best inferior-lisp option, but once I do a release and we get this latest reply code hooked up there, lein repl should work fine.


technomancy commented Jul 31, 2012

@jimm lein repl is your best bet if you want to use inferior-lisp, (you're just stuck with the version of reply that Leiningen uses) but if you just want to avoid the complexity of slime I'd recommend https://github.com/kingtim/nrepl.el instead.

jimm commented Jul 31, 2012

Thanks, @trptcolin and @technomancy.

@trptcolin trptcolin closed this Aug 9, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment