branch: elpa/dart-mode
commit c54f014ac96160e82490f486e050ff5320e2fd89
Merge: 88920ee d6bb4e8
Author: Natalie Weizenbaum <[email protected]>
Commit: Natalie Weizenbaum <[email protected]>
Merge pull request #18 from hterkelsen/no_pty
Use a pipe instead of a pty for the analysis server
---
dart-mode.el | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/dart-mode.el b/dart-mode.el
index 7c2c4a7..684fd1a 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -685,11 +685,18 @@ directory or the current file directory to the analysis
roots."
(dart--analysis-server-process dart--analysis-server))
(kill-buffer (dart--analysis-server-buffer dart--analysis-server)))
(let ((dart-process
- (start-process "dart-analysis-server"
- "*dart-analysis-server*"
- dart-executable-path
- dart-analysis-server-snapshot-path
- "--no-error-notification")))
+ ;; set process-connection-type to nil so that emacs starts
+ ;; the analysis server controlled by a pipe rather than a
+ ;; pseudo-terminal. If the process is controlled by a
+ ;; pseudo-terminal, emacs will buffer requests to the analysis
+ ;; server with interspersed EOFs, which confuses the analysis
+ ;; server. This does not happen with pipes.
+ (let ((process-connection-type nil))
+ (start-process "dart-analysis-server"
+ "*dart-analysis-server*"
+ dart-executable-path
+ dart-analysis-server-snapshot-path
+ "--no-error-notification"))))
(setq dart--analysis-server
(dart--analysis-server-create dart-process))))