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

REPL: running inside emacs crashes (shell, eshell) or prompt is double-printed (term) #6428

Closed
kmsquire opened this issue Apr 5, 2014 · 11 comments · Fixed by #6560
Closed
Labels
bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version REPL Julia's REPL (Read Eval Print Loop)

Comments

@kmsquire
Copy link
Member

kmsquire commented Apr 5, 2014

When running the latest julia (0.3.0-prerelease+2494) inside emacs, julia either crashes (shell, eshell):

$ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" to list help topics
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.0-prerelease+2494 (2014-04-04 23:25 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 7d495c0* (0 days old master)
|__/                   |  x86_64-linux-gnu

�[?2004h�[0G�[0Kjulia> �[?2004lERROR: integer division error
 in div at promotion.jl:172

$ 

or the prompt is double printed (eterm-color):

julia> 1+1julia> 1+1
2

julia> julia> 2+2julia> 2+2
4

This issue should perhaps be retitled something like "allow use with limited terminals".

Somewhat related: #5271

@kmsquire kmsquire added the REPL label Apr 5, 2014
@kmsquire kmsquire changed the title REPL: running inside emacs crashes (shell, eshell) or is garbled (term) REPL: running inside emacs crashes (shell, eshell) or prompt is double-printed (term) Apr 5, 2014
@farrellm
Copy link

farrellm commented Apr 6, 2014

I see the same "ERROR: integer division error" with the ESS inferior Julia mode (M-x julia).

@zaphar
Copy link

zaphar commented Apr 10, 2014

This appears to be because the new LineEditREPL doesn't play nice with emacs.

I've got a really hacky version using StreamREPL working in a branch I'm playing with and it succeeds.

Not sure why yet though.

As a related bug. The StreamREPL in REPL.jl is broken at head right now. run_repl(s::AsyncStream) isn't even valid code.

@StefanKarpinski
Copy link
Member

This business of running a REPL inside of emacs' very limited terminal emulation just strikes me as the wrong way to go about things. What about using something like emacs IPython notebook instead?

@kmsquire
Copy link
Member Author

I've actually tried that before (in Python, I think). It's okay, but I
tend to prefer the regular REPL in general.

To be clear, this is not a huge deal to me personally.

On Thu, Apr 10, 2014 at 9:46 AM, Stefan Karpinski
[email protected]:

This business of running a REPL inside of emacs' very limited terminal
emulation just strikes me as the wrong way to go about things. What about
using something like emacs IPython notebookhttp://tkf.github.io/emacs-ipython-notebook/instead?


Reply to this email directly or view it on GitHubhttps://github.com//issues/6428#issuecomment-40109061
.

@StefanKarpinski
Copy link
Member

I just watch people struggle with the basic REPL in emacs and it's kind of painful. It's just weird that Julia is going to great pains to make the terminal do useful things while emacs is struggling to pretend to be a terminal. Emacs has a programming language, Julia is easy to call. Why isn't this smoother and easier?

@JeffBezanson
Copy link
Member

It should be simple to use the REPL in pipe mode, which is already implemented for the case where something is redirected into julia.

@farrellm
Copy link

Running Julia through the ESS REPL was a very nice interface for interactive development. Moreover, Org/Babel eval Julia code through the ESS REPL, which I am very interested in using.

If there is a workaround to get IJulia or a pipe mode REPL running through ESS, that's probably sufficient for my purposes. I'd be very happy to help test or debug, just let me know.

@zaphar
Copy link

zaphar commented Apr 10, 2014

I think the issue is that ess is currently the best way to edit julia code in emacs. Code completion, evaluation, eldoc... All of this makes for a really nice environment. Most of that required having the julia process there though and right now that process has no way go into a basic mode.

The simple fix in the short run is to have a switch perhaps on command line that puts the repl in basic mode. A longer term fix is for someone to tackle a better integration in ess.

As it stands right now if 0.3 is released like this then a whole lot of people are going be frustrated with the experience of editing julia code.

@StefanKarpinski
Copy link
Member

It shouldn't be too hard to add a --line-edit=[true|false|auto] option for the julia client.

@zaphar
Copy link

zaphar commented Apr 10, 2014

That is pretty close to what my "very hacky" change I experiemented with does.

@farrellm
Copy link

Julia no longer crashes under emacs! (due to #6419 being fixed?)
Babel now works very well.
Though the ESS REPL works, it is now a mess of duplicate prompts and control characters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants