From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Constantin Kulikov Newsgroups: gmane.emacs.bugs Subject: bug#72345: 29.4; Emacs daemon on Windows OS Date: Mon, 29 Jul 2024 01:08:44 +0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000896a95061e55fdb7" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="774"; mail-complaints-to="usenet@ciao.gmane.io" To: 72345@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 29 00:10:17 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sYC5o-000AbT-MH for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Jul 2024 00:10:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sYC5R-0001c5-3f; Sun, 28 Jul 2024 18:09:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sYC5P-0001bo-Cy for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2024 18:09:51 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sYC5O-0007Bx-5l for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2024 18:09:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:MIME-Version:To:Subject; bh=b0StA1yyWkiyznTVmNDsO5B/7gt+aISTbbNARjCPjc8=; b=lNhKI0FcIYQn5Whe/v6bB80fd00idX7DYFImM9KrCVVqwZBiuEMyTTuyfqvgcz2Dh5hRw5YiOC4e+C2gAGToSlx/I6U/5/1anU4mtZsiNKQlT+ZKlnKzxBnbNxkp7osORDW1CkRcOyjMX6D3403IBqufcUI/rG8LqF5mlLk7PDvy/tIATBAuuy32fZVh1DuABk/ab1MOpEiRQ15isNYZ0zV+7ucNQ2bYEOM4+yXUfcrmkIWK/+UxN8galZCxI43SB1udcbP56f7syhWNUaM6M+zGwvT7R+08Yor6T26E/TUuXtByAsU1q+Q2AU2ujnWqJ2xvuFX8I/a1pg1A8QVR6Q==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sYC5a-0005Wt-17 for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2024 18:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Constantin Kulikov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Jul 2024 22:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72345 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.172220455421195 (code B ref -1); Sun, 28 Jul 2024 22:10:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Jul 2024 22:09:14 +0000 Original-Received: from localhost ([127.0.0.1]:44430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sYC4o-0005Vm-4C for submit@debbugs.gnu.org; Sun, 28 Jul 2024 18:09:14 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:55680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sYC4l-0005Ve-Gv for submit@debbugs.gnu.org; Sun, 28 Jul 2024 18:09:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sYC4Z-0001Xr-AP for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2024 18:08:59 -0400 Original-Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sYC4X-00078a-IT for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2024 18:08:59 -0400 Original-Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a7aa4ca9d72so386329066b.0 for ; Sun, 28 Jul 2024 15:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722204535; x=1722809335; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=b0StA1yyWkiyznTVmNDsO5B/7gt+aISTbbNARjCPjc8=; b=PbP0RXX+zbEZ6AZdZymzjOZF3Qt1OdMkggGZSpFBR5csPKovS3jpAZHYFTRhzqSZ0e dFjXOe/F+urQeh748HjrHOnT1HulRvfTZwmQZ/DMevhNP0tTII13eme/QQ1ro2fcMp6w f0z0Rr2ytQ3zdaXmCY6n/tTlBACH0C0SXi0vsc9GbBNY/2jCQAaVDYFAyyuU61xa9gfg R1Q/5eN0CNSy/NHvM/f0zuWqMhF9Nz1dOu6wqdSlS6L/a8G7XIZ+LqOXAvzdxqfyGolZ uxks8Z58ZQx68aN+IVGGYv1noyQtrdcLXaXkKfdqHtYrt/Db9j60sCvGiBBBK0GiLbCG D0oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722204535; x=1722809335; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=b0StA1yyWkiyznTVmNDsO5B/7gt+aISTbbNARjCPjc8=; b=AQy5keJEd33ul8ipiB/dTrz2KOxFCWydW3ZBouKqLYw8cCs8FpGe8UhTqrRD5tQviK bFsXvbOI+PEfEQkffF3I1sSjqPAn2tyjjXETMMAmm5OiMb+9GBRfqChPSUWBa2WpTiR0 hdVRySDbLvKOCThCHkaa1EGhkfwG66e3I9aLY6SzjRHkNjfsEgXb2hP/QZ1hM21AXTiM phzkj3cTak40yXX7o4JgAVzUHDO/Ahmn+rqd/tN9esNKcvzoiM2kl7It0moAfUiJeIV7 EW+PoKlfYM/9BDQ+Sf9cHxSTFMottEiYomX7kVeFdN97oXKS0jmiKl2wO0ny+ZKbXKGL w2Jw== X-Gm-Message-State: AOJu0YzWJKIRnQsSldq0pEV9m4XB7VvHfPFHGQLOZTdYSMlvtXvh6S4a R91kZ0nfQ4T9g6QieI1bb9yA1Zzz97hj3E+rzVIW1sbFQXSEt3ipI0cd8cz0v8zer/wrbs8hrJA HWQHl8NQhlYMX1+t3duM02qgCTbpba8kk X-Google-Smtp-Source: AGHT+IFOCri6MKaM/Wmob/xkcJy48USY55fSjYxXxSlkTa4QudK+8Lz0Lin1XJGdcyPj+8Em5XmmR7QlZk7tPa5MOEM= X-Received: by 2002:a17:907:728c:b0:a7a:a892:8e0b with SMTP id a640c23a62f3a-a7d40015a95mr383681266b.19.1722204534957; Sun, 28 Jul 2024 15:08:54 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=zxnotdead@gmail.com; helo=mail-ej1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289498 Archived-At: --000000000000896a95061e55fdb7 Content-Type: text/plain; charset="UTF-8" Trying to use emacs daemon on Windows: In powershell, cd where emacs is unziped and run it: ``` # .\bin\emacs.exe -q --load D:\path-to-my-init\init.el --daemon ``` I use emacs.exe but it does not matter if I use runemacs.exe here and in all other commands mentioned in this bugreport, the only difference is that the emacs process is detached from the terminal. The first problem was the "server socket" file. It was not created. Then I tried without loading my init.el: ``` # .\bin\emacs.exe -q --daemon ``` The server file was created in C:\Users\User\AppData\Roaming\.emacs.d\server That's ok, but I need it to be in another location. Internet suggests to set EMACS_SERVER_FILE environment variable, so I set it in powershell before running emacs: ``` # $env:EMACS_SERVER_FILE = "D:\emacs\.emacs.d\server\server" ``` Seems like it's ignored by emacs. Maybe it's outdated. Then I tried loading my init.el again, the server file was not created. I tried starting with --debug, etc. No errors. Then I added `(server-start)` and other server-* settings to init.el, restarted emacs and got the server file in the desired location. Now it is time for emacsclient (emacsclientw makes no difference here): ``` # .\bin\emacsclient.exe -server-file "$(Resolve-Path '.\.emacs.d\server\server')" -c ``` The frame was created. Success? I'm pressing M-x to enter a command and... emacs is waiting for input but not in GUI frame but in terminal where the daemon was started! (runemacs.exe --daemon waits input somewhere nowhere) Fail! (And even the input from terminal is not working properly in that case. You can enter string to terminal and it reacts to Enter key press, but seems like input received by emacs is always nil) In GNU Emacs 29.4 (build 2, x86_64-w64-mingw32) of 2024-07-05 built on AVALON Windowing system distributor 'Microsoft Corp.', version 10.0.20348 System Description: Microsoft Windows Server 2022 Datacenter (v10.0.2009.20348.1366) Configured using: 'configure --with-modules --without-dbus --with-native-compilation=aot --without-compress-install --with-sqlite3 --with-tree-sitter CFLAGS=-O2' Configured features: ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB (NATIVE_COMP present but libgccjit not available) --000000000000896a95061e55fdb7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Trying to use emacs daemon on Windows:

In powershel= l, cd where emacs is unziped and run it:

```
# .\bin\emacs.exe -q --load D:\path-to-my-init\init.el --daemon
```

I use emacs.exe but it does not matter if I use runemacs.exe= here and in
all other commands mentioned in this bugreport, the only di= fference is
that the emacs process is detached from the terminal.
The first problem was the "server socket" file. It was not creat= ed. Then I
tried without loading my init.el:

```
# .\bin\emacs.exe -q --daemon
```

The server f= ile was created in
C:\Users\User\AppData\Roamin= g\.emacs.d\server

That's ok, but I need it to be in anoth= er location. Internet suggests to
set EMACS_SERVER_FILE environment vari= able, so I set it in powershell
before running emacs:

```
# $env:EMACS_SERVER_FILE =3D "D:\emacs\.emacs.d\s= erver\server"

```

Seems like it's ignored by emac= s. Maybe it's outdated.

Then I tried loading my init.el again, t= he server file was not created.
I tried starting with --debug, etc. No = errors. Then I added
`(server-start)` and other server-* settings to ini= t.el, restarted emacs
and got the server file in the desired location.Now it is time for emacsclient (emacsclientw makes no difference here):
```
# .\bin\emacsclient.exe -server-file = "$(Resolve-Path '.\.emacs.d\server\server')" -c ```

The frame was created. Success? I'm pressing M-x to enter = a command
and... emacs is waiting for input but not in GUI frame but in = terminal
where the=C2=A0daemon was started! (runemacs.exe --daemon waits= input somewhere nowhere)
Fail!
(And even the input from terminal is = not working properly in=C2=A0that case. You can enter
string to terminal= and it reacts to Enter key press, but seems like
input received by emac= s is always nil)


In GNU Emacs 29.4 (build 2, x86_64-w64-mingw32)= of 2024-07-05 built on
=C2=A0AVALON
Windowing system distributor = 9;Microsoft Corp.', version 10.0.20348
System Description: Microsoft= Windows Server 2022 Datacenter (v10.0.2009.20348.1366)

Configured u= sing:
=C2=A0'configure --with-modules --without-dbus --with-native-c= ompilation=3Daot
=C2=A0--without-compress-install --with-sqlite3 --with-= tree-sitter
=C2=A0CFLAGS=3D-O2'

Configured features:
ACL G= IF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIF= Y W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_B= ARS TREE_SITTER WEBP XPM ZLIB

(NATIVE_COMP present but libgccjit not= available)
--000000000000896a95061e55fdb7--