all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Running Emacs in an MSYS2 shell (or terminal?)
@ 2022-01-25 16:37 H. Dieter Wilhelm
  2022-01-25 17:02 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: H. Dieter Wilhelm @ 2022-01-25 16:37 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

when starting Emacs with

  $ ./emacs.exe -nw

it says

  emacs: standard input is not a tty.

and "emacsclient.exe -nw" is creating a new frame.

What can I do to use emacs.exe or emacsclient.exe in such a shell
without starting a new frame?

Thank you

      Dieter
-- 
Best wishes
H. Dieter Wilhelm
Zwingenberg, Germany




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Running Emacs in an MSYS2 shell (or terminal?)
  2022-01-25 16:37 Running Emacs in an MSYS2 shell (or terminal?) H. Dieter Wilhelm
@ 2022-01-25 17:02 ` Eli Zaretskii
  2022-01-25 19:20   ` H. Dieter Wilhelm
  2022-01-25 17:51 ` Óscar Fuentes
  2022-01-26  9:24 ` Arash Esbati
  2 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2022-01-25 17:02 UTC (permalink / raw)
  To: help-gnu-emacs

> From: "H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de>
> Date: Tue, 25 Jan 2022 17:37:17 +0100
> 
> when starting Emacs with
> 
>   $ ./emacs.exe -nw
> 
> it says
> 
>   emacs: standard input is not a tty.
> 
> and "emacsclient.exe -nw" is creating a new frame.
> 
> What can I do to use emacs.exe or emacsclient.exe in such a shell
> without starting a new frame?

Is this when invoking Emacs from mintty (or what's the default
terminal program in MSYS2 is called these days)?  If so, I think this
is a question for MSYS2 folks or maybe for Cygwin folks.  Basically, I
believe stdin is a pipe in that case, and Emacs cannot cope with that
in -nw mode.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Running Emacs in an MSYS2 shell (or terminal?)
  2022-01-25 16:37 Running Emacs in an MSYS2 shell (or terminal?) H. Dieter Wilhelm
  2022-01-25 17:02 ` Eli Zaretskii
@ 2022-01-25 17:51 ` Óscar Fuentes
  2022-01-25 19:31   ` H. Dieter Wilhelm
  2022-01-26  9:24 ` Arash Esbati
  2 siblings, 1 reply; 10+ messages in thread
From: Óscar Fuentes @ 2022-01-25 17:51 UTC (permalink / raw)
  To: help-gnu-emacs

"H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de> writes:

> when starting Emacs with
>
>   $ ./emacs.exe -nw
>
> it says
>
>   emacs: standard input is not a tty.
>
> and "emacsclient.exe -nw" is creating a new frame.
>
> What can I do to use emacs.exe or emacsclient.exe in such a shell
> without starting a new frame?

MSYS2/Cygwin console is not a proper console as far as windows "native"
executables are concerned. If you insist on running MinGW-w64 Emacs on
it, try this:

$ pacman -S winpty
$ winpty ./emacs -nw




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Running Emacs in an MSYS2 shell (or terminal?)
  2022-01-25 17:02 ` Eli Zaretskii
@ 2022-01-25 19:20   ` H. Dieter Wilhelm
  0 siblings, 0 replies; 10+ messages in thread
From: H. Dieter Wilhelm @ 2022-01-25 19:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

>> From: "H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de>
>> Date: Tue, 25 Jan 2022 17:37:17 +0100
>> 
>> when starting Emacs with
>> 
>>   $ ./emacs.exe -nw
>> 
>> it says
>> 
>>   emacs: standard input is not a tty.
>> 
>> and "emacsclient.exe -nw" is creating a new frame.
>> 
>> What can I do to use emacs.exe or emacsclient.exe in such a shell
>> without starting a new frame?
>
> Is this when invoking Emacs from mintty (or what's the default
> terminal program in MSYS2 is called these days)?

yes, mintty (3.5.2)

> If so, I think this is a question for MSYS2 folks or maybe for Cygwin
> folks.  Basically, I believe stdin is a pipe in that case, and Emacs
> cannot cope with that in -nw mode.

Thanks

-- 
Best wishes
H. Dieter Wilhelm
Zwingenberg, Germany



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Running Emacs in an MSYS2 shell (or terminal?)
  2022-01-25 17:51 ` Óscar Fuentes
@ 2022-01-25 19:31   ` H. Dieter Wilhelm
  0 siblings, 0 replies; 10+ messages in thread
From: H. Dieter Wilhelm @ 2022-01-25 19:31 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: help-gnu-emacs

Óscar Fuentes <ofv@wanadoo.es> writes:

> "H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de> writes:
>
>> when starting Emacs with
>>
>>   $ ./emacs.exe -nw
>>
>> it says
>>
>>   emacs: standard input is not a tty.
>>
>> and "emacsclient.exe -nw" is creating a new frame.
>>
>> What can I do to use emacs.exe or emacsclient.exe in such a shell
>> without starting a new frame?
>
> MSYS2/Cygwin console is not a proper console as far as windows "native"
> executables are concerned. If you insist on running MinGW-w64 Emacs on
> it, try this:
>
> $ pacman -S winpty
> $ winpty ./emacs -nw

Great Óscar! Thank you. :-)

(Even though I couln't even type C-x C-c any more, had to close emacs
 from the menu. :-) )

Unfortunately even winpty is not working for

$ winpty ./emacsclient.exe -nw 

it still opens a new frame!?  At least with emacs-28.0.91 build from
Corwin (there are warning, two DLLs are missing).  If you think it is
worthwhile to check with Emacs-27.2, I'll do this tomorrow?

   Dieter
-- 
Best wishes
H. Dieter Wilhelm
Zwingenberg, Germany



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Running Emacs in an MSYS2 shell (or terminal?)
  2022-01-25 16:37 Running Emacs in an MSYS2 shell (or terminal?) H. Dieter Wilhelm
  2022-01-25 17:02 ` Eli Zaretskii
  2022-01-25 17:51 ` Óscar Fuentes
@ 2022-01-26  9:24 ` Arash Esbati
  2022-01-26 16:55   ` H. Dieter Wilhelm
  2 siblings, 1 reply; 10+ messages in thread
From: Arash Esbati @ 2022-01-26  9:24 UTC (permalink / raw)
  To: H. Dieter Wilhelm; +Cc: help-gnu-emacs

"H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de> writes:

> when starting Emacs with
>
>   $ ./emacs.exe -nw
>
> it says
>
>   emacs: standard input is not a tty.

As others said, mintty isn't the right choice here.  Open the file
msys2_shell.cmd (in Msys2 installtion root) in your favorite editor and
look for the usage at the end of the file.  Try to run that script with
"-defterm -mingw64" and see if it works (without winpty).

Best, Arash



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Running Emacs in an MSYS2 shell (or terminal?)
  2022-01-26  9:24 ` Arash Esbati
@ 2022-01-26 16:55   ` H. Dieter Wilhelm
  2022-01-26 17:32     ` Eli Zaretskii
  2022-01-26 18:31     ` Arash Esbati
  0 siblings, 2 replies; 10+ messages in thread
From: H. Dieter Wilhelm @ 2022-01-26 16:55 UTC (permalink / raw)
  To: Arash Esbati; +Cc: help-gnu-emacs

Hello Arash,

Arash Esbati <arash@gnu.org> writes:

> "H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de> writes:
>
>> when starting Emacs with
>>
>>   $ ./emacs.exe -nw
>>
>> it says
>>
>>   emacs: standard input is not a tty.
>
> As others said, mintty isn't the right choice here.  Open the file
> msys2_shell.cmd (in Msys2 installtion root) in your favorite editor and
> look for the usage at the end of the file.  Try to run that script with
> "-defterm -mingw64" and see if it works (without winpty).

This is working for "emacs.exe -nw".  In fact, out of the box, it works
even better than "winpty emacs.exe -nw", where keyboard shortcuts like
"C-x C-c" aren't working for me!

Unfortunately, for the more important use case, "emacsclient.exe -nw
test.txt", or the like, a new frame - outside of the "defterm" window -
is always opening up.

(I'm just testing the limits of Emacsland under Windows - to steel a
 designation of Eli Zaretskii.)  :-)

Thank you

      Dieter
-- 
Best wishes
H. Dieter Wilhelm
Zwingenberg, Germany



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Running Emacs in an MSYS2 shell (or terminal?)
  2022-01-26 16:55   ` H. Dieter Wilhelm
@ 2022-01-26 17:32     ` Eli Zaretskii
  2022-01-26 18:36       ` H. Dieter Wilhelm
  2022-01-26 18:31     ` Arash Esbati
  1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2022-01-26 17:32 UTC (permalink / raw)
  To: help-gnu-emacs

> From: "H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de>
> Date: Wed, 26 Jan 2022 17:55:32 +0100
> Cc: help-gnu-emacs@gnu.org
> 
> Unfortunately, for the more important use case, "emacsclient.exe -nw
> test.txt", or the like, a new frame - outside of the "defterm" window -
> is always opening up.

It is not clear to me what did you expect to happen with emacsclient
invocation with the -nw switch.  Emacs on MS-Windows cannot create a
new console window, nor can it "attach" to an existing console
window.  Moreover, it cannot have both TTY and GUI frames in the same
session.

With these limitations, does anything look out of order in the
behavior that you see?



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Running Emacs in an MSYS2 shell (or terminal?)
  2022-01-26 16:55   ` H. Dieter Wilhelm
  2022-01-26 17:32     ` Eli Zaretskii
@ 2022-01-26 18:31     ` Arash Esbati
  1 sibling, 0 replies; 10+ messages in thread
From: Arash Esbati @ 2022-01-26 18:31 UTC (permalink / raw)
  To: H. Dieter Wilhelm; +Cc: help-gnu-emacs

Hi Dieter,

"H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de> writes:

> This is working for "emacs.exe -nw".  In fact, out of the box, it works
> even better than "winpty emacs.exe -nw", where keyboard shortcuts like
> "C-x C-c" aren't working for me!

Glad to hear that.  For me, even mouse works and I can choose items in
the menu bar with it (well, I could if I wanted to and don't need F10).

> Unfortunately, for the more important use case, "emacsclient.exe -nw
> test.txt", or the like, a new frame - outside of the "defterm" window -
> is always opening up.

I'm not sure if I understand your expectation here.  For me, I can do
"emacs -nw" in a shell, open a .tex file, compile it with synctex
activated (C-c C-c), start a Win32 viewer (in my case SumatraPDF) from
Emacs (With AUCTeX, it is with C-c C-v), double-click a text position in
the viewer and Emacs jumps to that position.  The config in the viewer
is:

Z:\path\to\emacs\bin\emacsclientw.exe -n --alternate-editor="" +%l "%f"

My understanding is that emacsclientw connects to the server it finds.

What is the use-case you have in mind?

P.S. I probably should change that config to

Z:\path\to\emacs\bin\emacsclientw.exe -n --alternate-editor=runemacs +%l "%f"

which is more convenient.

Best, Arash



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Running Emacs in an MSYS2 shell (or terminal?)
  2022-01-26 17:32     ` Eli Zaretskii
@ 2022-01-26 18:36       ` H. Dieter Wilhelm
  0 siblings, 0 replies; 10+ messages in thread
From: H. Dieter Wilhelm @ 2022-01-26 18:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

>> From: "H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de>
>> Date: Wed, 26 Jan 2022 17:55:32 +0100
>> Cc: help-gnu-emacs@gnu.org
>> 
>> Unfortunately, for the more important use case, "emacsclient.exe -nw
>> test.txt", or the like, a new frame - outside of the "defterm" window -
>> is always opening up.
>
> It is not clear to me what did you expect to happen with emacsclient
> invocation with the -nw switch.  Emacs on MS-Windows cannot create a
> new console window, nor can it "attach" to an existing console
> window.  Moreover, it cannot have both TTY and GUI frames in the same
> session.

I'm sorry for the ambiguity.  I wanted to emualate emacsclient -nw under
Gnu-Linux, namely, to operate it in a text console (TTY?) when Emacs is
running as a GUI application.

> With these limitations, does anything look out of order in the
> behavior that you see?

No, I just didn't know these limitations of Windows, only the
capabilites under Linux.  In fact, since this year I can do so much more
with Emacs (and MSYS2) under Windows than I previously expected! :-)

Compiling Emacs (Magit)
Compling LaTeX documents
PDF-tools is working
Running R with graphics output
Spellchecking with Hunspell
Encrypting .authinfo
Running Gnus
Using Tramp to connect to Linux servers

You helped me with most parts, thank you very much.

    Dieter



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-01-26 18:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-25 16:37 Running Emacs in an MSYS2 shell (or terminal?) H. Dieter Wilhelm
2022-01-25 17:02 ` Eli Zaretskii
2022-01-25 19:20   ` H. Dieter Wilhelm
2022-01-25 17:51 ` Óscar Fuentes
2022-01-25 19:31   ` H. Dieter Wilhelm
2022-01-26  9:24 ` Arash Esbati
2022-01-26 16:55   ` H. Dieter Wilhelm
2022-01-26 17:32     ` Eli Zaretskii
2022-01-26 18:36       ` H. Dieter Wilhelm
2022-01-26 18:31     ` Arash Esbati

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.