-
Notifications
You must be signed in to change notification settings - Fork 84
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
Display all output when no prompt was found? #47
Comments
One problem you're going to face with this is the fact that Codi attempts to line up REPL output to the source buffer's line. At the most this would be a debug option and I wouldn't be surprised if it already existed (it does in logs, but I don't know if the logs go to the scratch buffer like you'd expect). |
The error case means that there is nothing to line up, but only the error. This could be also detected through the exit code maybe additionally. |
This is currently not possible because the code keeps count of the number of prompts seen until the expected number is reached, at which point it ends the process and shows the output. In your example, Codi would be waiting for a prompt that never comes. However, it can't just display the output, as it doesn't know whether or not the program is just taking awhile to display the first prompt. Maybe some sort of timeout for the first prompt would be helpful, as that should always be quick on most repls. |
My idea was to handle this when the output/job is done: if there was no prompt found, (and/or the exit-status is non-zero) it would display the last line(s) from the output. |
I suppose that could work. I don't have the bandwidth to do more feature work on Codi at the moment, but I would happily accept pull requests for this. |
I also think this would be sweet. Maybe if it just dumps the I'm new to Vim, so I doubt my Vim Script would be up to par. Codi's part of my daily workflow though; thanks for the plugin. |
I think it might be useful to put all output into the scratch buffer in case the expected prompt was not found.
This would help with issues, where e.g.
rlwrap
complainsrlwrap: error: My terminal reports width=0 (is it emacs?) I can't handle this, sorry!
.In this case the scratch buffer could have a note that something failed and provide that output (which means to remove the input that codi sent itself, if it was echoed).
(btw: I have noticed the
rlwrap
problem with Vim, but not Neovim btw. Likely related to the not yet implemented "term" option (see:h job-term
).)The text was updated successfully, but these errors were encountered: