J3RN / inf-elixir

An Emacs plugin for interacting with an Elixir REPL
GNU General Public License v3.0
44 stars 10 forks source link

duplicate display of intermediate prompt, and truncates lines at 4096 characters #17

Open bo-tato opened 11 months ago

bo-tato commented 11 months ago

We ran into this in inf-ruby (https://github.com/nonsequitur/inf-ruby/issues/172) and I was trying out other repl's to see if they have the same issue. Basically pty on linux has a maximum line length of 4096 characters. python-mode solves this by simply saving the region to a temp file and evaling the temp file, if the length is over comint-max-line-length.

Another minor display issue is it shows extra intermediate prompts, for example: 2023-09-25-174443_1146x262_scrot It'd be nicer if it didn't show a bunch of duplicate ...(n)> when you eval some region. Some repl like tuareg-mode for ocaml solve this by spawning the repl with a cli option to not display intermediate prompts on multiline input. Some repl like python-mode solve this by sending multiline input as a singleline string with newline escaped and running it with a single eval statement.

It'd be nice if comint mode could somehow solve this in general rather than every language repl running into these two issues and making their own solution, but I'm not really sure what comint could do about it.