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
Start a subprocess in the Before hook, get terminal control characters in its output #149
Comments
Here's a small batch of my test output where you can see the position of the characters.
|
I have a lot of porting to do next. My motivation: using ecukes to manage a subprocess in emacs causes ANSI control characters to appear in the subprocess's output. I found no way around this, and actually opened an issue about it here: ecukes/ecukes#149 If the issue gets resolved, I might switch back. Until then, we use buttercup to do the same thing a little uglier.
It might have to do with how Espuds works as it tries to do thing as similar to a real human as possible. How are you communicating with the process? If you are using things like |
Yes, I'm using As the process output is asynchronous, I created this helper function to wait or timeout a request. I think waiting might have something to do with the error (just a guess). Here's the way it works just in case it's useful: I have a global alist of response handler functions stored. Each request gets associated a handler when it's sent to the background process, and when a response comes, the handler is removed. Using this I detect which requests are completed: (defun omnisharp--wait-until-request-completed (request-id
&optional timeout-seconds)
(setq timeout-seconds (or timeout-seconds 2))
(let ((start-time (current-time)))
(while (omnisharp--handler-exists-for-request request-id)
(when (> (cadr (time-subtract (current-time) start-time))
timeout-seconds)
(progn
(let ((msg (format "Request %s did not complete in %s seconds"
request-id timeout-seconds)))
(omnisharp--log msg)
(error msg))))
(accept-process-output nil 0.01)))
request-id) The waiting code I essentially copied from the Now I switched to using buttercup and the problem is gone, so I think your guess might be right. |
I ran the tests using |
Hi, I'm using ecukes for omnisharp-emacs, and it's a great fit. The project used to work with a local http server and all tests would run fine. Now I'm adding support for having the server as a subprocess, and communicating with the process's input and output streams.
I'm running into a problem where the subprocess gets as its input some control characters, like
^[[6n
and^[[?1h^[=^[[6n
. The output of the subprocess is json data, and these cause problems with deserialization. They also don't occur when running emacs interactively, that is, "normally".I'm a bit confused by this. Would you have any idea what to do about these characters?
The text was updated successfully, but these errors were encountered: