unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Emacs, MSYS2 bash and term mode
@ 2017-04-07 10:02 Fabrice Popineau
  2017-04-07 12:43 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Popineau @ 2017-04-07 10:02 UTC (permalink / raw)
  To: Emacs developers, Msys2


[-- Attachment #1.1: Type: text/plain, Size: 1009 bytes --]

Hi lists,

Currently, it seems that no terminal emulator runs the msys2 bash under a
mingw64 emacs.
I am reporting against emacs 25.2.
My findings up to now :
- "/bin/sh" is hardwired in lisp/term.el whereas the full windows path to
bash.exe has to be given in term-exec-1
- the command that is run in term-exec-1 is built by :
    (apply 'start-process name buffer
           (getenv "SHELL") "-c"
  (format "stty -nl echo rows %d columns %d sane 2>/dev/null;\
if [ $1 = .. ]; then shift; fi; exec \"$@\""
  term-height term-width)
  ".."
  command "-i" switches)))

I had to add the "-i" option to bash.exe, else bash won't communicate with
emacs

- the stty seems to be ignored by bash, anyway the buffer doesn't get
proper cr
- term.el tries to track the current directory and calls the cd function
with msys2 paths. This obviously fails because emacs being mingw64 emacs
expects windows paths.

Did anybody manage to run term.el with the msys2 bash from a windows emacs ?

Thanks for your help,

Fabrice

[-- Attachment #1.2: Type: text/html, Size: 1701 bytes --]

[-- Attachment #2: Type: text/plain, Size: 202 bytes --]

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

[-- Attachment #3: Type: text/plain, Size: 192 bytes --]

_______________________________________________
Msys2-users mailing list
Msys2-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/msys2-users

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

* Re: Emacs, MSYS2 bash and term mode
  2017-04-07 10:02 Emacs, MSYS2 bash and term mode Fabrice Popineau
@ 2017-04-07 12:43 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2017-04-07 12:43 UTC (permalink / raw)
  To: Fabrice Popineau; +Cc: msys2-users, emacs-devel

> From: Fabrice Popineau <fabrice.popineau@gmail.com>
> Date: Fri, 7 Apr 2017 12:02:03 +0200
> 
> Currently, it seems that no terminal emulator runs the msys2 bash under a mingw64 emacs.
> I am reporting against emacs 25.2.
> My findings up to now :
> - "/bin/sh" is hardwired in lisp/term.el whereas the full windows path to bash.exe has to be given in
> term-exec-1
> - the command that is run in term-exec-1 is built by :
> (apply 'start-process name buffer
> (getenv "SHELL") "-c"
> (format "stty -nl echo rows %d columns %d sane 2>/dev/null;\
> if [ $1 = .. ]; then shift; fi; exec \"$@\""
> term-height term-width)
> ".."
> command "-i" switches)))
> 
> I had to add the "-i" option to bash.exe, else bash won't communicate with emacs
> 
> - the stty seems to be ignored by bash, anyway the buffer doesn't get proper cr
> - term.el tries to track the current directory and calls the cd function with msys2 paths. This obviously fails
> because emacs being mingw64 emacs expects windows paths.
> 
> Did anybody manage to run term.el with the msys2 bash from a windows emacs ?

I suggest not to waste your time: term.el assumes the communications
between the shell and Emacs are via a pty (otherwise, the shell won't
behave as if it displays on a terminal), while on Windows the only
method of communicating with subprocesses is via pipes.  That's why,
for example, the shell ignores stty.  More generally, that's why
term.el will never work on anything non-Posix.



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

end of thread, other threads:[~2017-04-07 12:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-07 10:02 Emacs, MSYS2 bash and term mode Fabrice Popineau
2017-04-07 12:43 ` Eli Zaretskii

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).