From: Jim Porter <jporterbugs@gmail.com>
To: Akib Azmain Turja <akib@disroot.org>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: Terminal emulator in Windows
Date: Wed, 11 Jan 2023 11:52:03 -0800 [thread overview]
Message-ID: <0d991256-94ae-ed25-9191-89bb540634d7@gmail.com> (raw)
In-Reply-To: <87v8ldkjvv.fsf@disroot.org>
On 1/11/2023 10:26 AM, Akib Azmain Turja wrote:
> Jim Porter <jporterbugs@gmail.com> writes:
>
>> On 1/11/2023 1:35 AM, Akib Azmain Turja wrote:
>>> In general, is it possible to implement Windows terminal emulation?
>>
>> Do you mean "emulating cmd.exe" or "emulating a terminal and running
>> that emulator on MS Windows"? The former might be trickier, and I
>
> I started the thread, and even I don't know. But I guess the latter.
> For more information, you may check the Eat issue 35 on Codeberg:
> https://codeberg.org/akib/emacs-eat/issues/35
In some ways this issue actually sounds more like the former. It sounds
like the user wants something like ConEmu[1] in Emacs. ConEmu's
implementation seems pretty hacky to me, since it relies on an invisible
Windows Console window[2].
On the other hand, there's the new-ish MS Windows API called ConPTY (as
the name implies, it gives you a pseudoterminal). This would give us
similar benefits compared to what ConEmu does, but using an
explicitly-supported API for it. This would be nice, since then Emacs
could just use pseudoterminals everywhere, which I think is what we
want. Unfortunately, it seems that this API isn't suitable for Emacs, as
discussed here[3] by Eli.
>> haven't really looked into how you'd do that. However, the latter
>> might just mean handling VT100 terminal sequences, which I don't think
>> would require knowing about any Windows-specific features/APIs.
>
> But somehow we need to tell the program what escape sequences to send,
> don't we?
From this discussion[4], it's the *program* that decides to opt in to
sending VT100 sequences to a Windows console. That is, if I wrote a
cross-platform program that uses VT100 sequences, I'd call
'SetConsoleMode' with 'ENABLE_VIRTUAL_TERMINAL_PROCESSING' in my MS
Windows port. Maybe Emacs could piggyback off of that.
I don't know if this would help solve the issue in the bug you linked,
but maybe something like this would work for handling VT100 sequences in
Eshell via 'eat-eshell-mode', or when running *nix programs remotely
through Tramp.
[1] https://conemu.github.io/
[2] https://conemu.github.io/en/RealConsole.html
[3] https://github.com/microsoft/terminal/issues/9174
[4] https://news.ycombinator.com/item?id=25866634
prev parent reply other threads:[~2023-01-11 19:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-10 8:08 Terminal emulator in Windows Akib Azmain Turja
2023-01-10 13:25 ` Eli Zaretskii
2023-01-10 16:15 ` Akib Azmain Turja
2023-01-10 17:06 ` Eli Zaretskii
2023-01-11 9:35 ` Akib Azmain Turja
2023-01-11 10:14 ` Po Lu
2023-01-11 12:48 ` Eli Zaretskii
2023-01-11 13:01 ` Po Lu
2023-01-11 13:19 ` Eli Zaretskii
2023-01-11 14:19 ` Rudolf Schlatte
2023-01-11 15:18 ` Akib Azmain Turja
2023-01-11 17:01 ` Eli Zaretskii
2023-01-11 18:27 ` Akib Azmain Turja
2023-01-11 19:55 ` Eli Zaretskii
2023-01-11 15:26 ` Akib Azmain Turja
2023-01-11 12:42 ` Eli Zaretskii
2023-01-11 15:11 ` Akib Azmain Turja
2023-01-11 17:01 ` Eli Zaretskii
2023-01-11 17:31 ` Jim Porter
2023-01-11 18:26 ` Akib Azmain Turja
2023-01-11 19:52 ` Jim Porter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0d991256-94ae-ed25-9191-89bb540634d7@gmail.com \
--to=jporterbugs@gmail.com \
--cc=akib@disroot.org \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).