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

Display all output when no prompt was found? #47

Open
blueyed opened this issue Oct 6, 2016 · 6 comments
Open

Display all output when no prompt was found? #47

blueyed opened this issue Oct 6, 2016 · 6 comments

Comments

@blueyed
Copy link
Contributor

blueyed commented Oct 6, 2016

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 complains rlwrap: 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).)

@Qix-
Copy link
Contributor

Qix- commented Oct 6, 2016

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).

@blueyed
Copy link
Contributor Author

blueyed commented Oct 6, 2016

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.
The logs are not put into the scratch buffer, but into a file.

@metakirby5
Copy link
Owner

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.

@blueyed
Copy link
Contributor Author

blueyed commented Oct 8, 2016

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.

@metakirby5
Copy link
Owner

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.

@Vvkmnn
Copy link

Vvkmnn commented Sep 18, 2017

I also think this would be sweet. Maybe if it just dumps the codi.log to the buffer? Would really speed up debugging.

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.

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

No branches or pull requests

4 participants