Replies: 8 comments
-
I believe this is due to the allocation of a pty. those escapes are coming out of conhost because the process was opted in for an interactive session. This is like giving a tty to a process: |
Beta Was this translation helpful? Give feedback.
-
Can you try wsltty with that same test? |
Beta Was this translation helpful? Give feedback.
-
It is impossible. The way As I understand the goal of this project is to launch Cygwin but not be launched by Cygwin. |
Beta Was this translation helpful? Give feedback.
-
That's true. I tied to trick Cygwin Emacs TRAMP mode by piping WSL over Cygwin's
Emacs TRAMP mode sends to Cygwin sh interpreter:
but still WSL generates ESC control sequences. There is no such issue when I execute Special option for activating WSL in PIPE mode will resolve this problem. I think that some thin custom wrapper that spawns WSL via pipe also will help, my attempts to write Cygwin script with "wsl -- sh | cat" didn't help. It should be written in C or with |
Beta Was this translation helpful? Give feedback.
-
I don’t know much about emacs, but couldn’t you remove |
Beta Was this translation helpful? Give feedback.
-
The problem is that Emacs TRAMP starts When I work directly with Emacs process API and change it to a pipe mode - there is no issues:
So it is a specific design of TRAMP (designed in a way similar to Ansible) prevents me to influence how WSL is started. Because they spawn an intermediate process. To make it work one is needed:
|
Beta Was this translation helpful? Give feedback.
-
I'll ask for advice in Cygwin and/or Emacs TRAMP mail lists in order for a solution that doesn't require changes on WSL sde. |
Beta Was this translation helpful? Give feedback.
-
I've got alternative solution that obsoletes need for TRAMP. After some hints from Cygwin mailing list I managed to "mount" WSL network P9 Details are here: https://cygwin.com/pipermail/cygwin/2020-November/246886.html The original report with suggestion to stop WSL (or conemu??) emitting special clearing sequences still valid as it might break another Expect-like bidirectional communication programs that jump from native Windows into WSL via |
Beta Was this translation helpful? Give feedback.
-
I tried to set WSL 1 connection type for Emacs TRAMP:
https://www.reddit.com/r/emacs/comments/jrkgmy/tramp_for_wsl_1_from_cygwin_emacsw32/
and debugging led me to code:
which shows following (I replaced occurrences of ESC byte, or #x1b, with
\e
):It is not clear if it comes from
conhost.exe
or fromwsl.exe
.pipe
mode orwsl echo OK | cat
disable garbage appearance but unfortunately Emacs TRAMP implementation startswsl
in the intermediate step and assumes that there is only one terminal (Cygwin's in my case), who can imagine that WSL creates intermediate "terminal"?Also if I launch interactive program, like
sh
WSL (or conhost??) periodically emits similar garbage. It make impossible to pipe data as they will be corrupted.So far:
wsl
itself we need special flag to disable terminal "smartness" of WSL - to tell to stop to emit any control sequences to clear terminal orWhy:
expect
-like programs (for example Emacs orexpect
from Cygwin) to automate interaction with WSL 1 viawsl cmd -opt1 -op2
like invocation.Beta Was this translation helpful? Give feedback.
All reactions