unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#71655: Eshell external commands do not work under GNU Emacs for Windows
@ 2024-06-19 15:53 James Hilling via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-06-19 19:12 ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: James Hilling via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-06-19 15:53 UTC (permalink / raw)
  To: 71655

[-- Attachment #1: Type: text/plain, Size: 5473 bytes --]

Hi all,

There appears to be a potential bug with Eshell when running external commands on GNU Emacs for Windows, i.e. not WSL/WSL2/Cygwin.

To reproduce:

Start Emacs with "-Q", open Eshell with `M-x eshell`, run `winget.exe --help`.

(Eshell) $ winget --help

Opening input file: Invalid argument, C:/Users/MyUser/AppData/Local/Microsoft/WindowsApps/winget.exe

For some reason external commands such as `winget.exe` do not appear to be working properly.

I thought that Eshell may be having issues when reading external command arguments, but running `winget.exe` on its own (with no arguments) also returns the same error.

What works:

Running `winget.exe --help` from the inferior shell works.

Running `cmd.exe /c winget.exe --help` from Eshell also works.

Is this a path related issue?

(Eshell) $ which winget.exe

C:/Users/MyUser/AppData/Local/Microsoft/WindowsApps/winget.exe

(Eshell) $ addpath

c:/Windows/system32
C:/Windows
C:/Windows/System32/Wbem
C:/Windows/System32/WindowsPowerShell/v1.0/
C:/Windows/System32/OpenSSH/
C:/Program Files (x86)/Gpg4win/../GnuPG/bin
C:/Program Files/PuTTY/
C:/Users/MyUser/AppData/Local/Microsoft/WindowsApps
.
C:/Users/MyUser/AppData/Local/Programs/oh-my-posh/bin

From the above output, Eshell appears to be aware of the path and therefore should also be able to execute commands such as `winget.exe`.

I tried launching other executables from `C:/Users/MyUser/AppData/Local/Microsoft/WindowsApps/` but they also fail in the exact same way.

Oddly enough, I can execute external commands within Eshell for executables under `c:/Windows/system32/`, e.g. I can execute `ipconfig.exe` from Eshell and it will work just fine. So this bug does not affect all external commands.

(Eshell) $ which ipconfig.exe

c:/Windows/system32/ipconfig.exe

I then tried running Emacs as an administrator (for troubleshooting purposes) but this also gave me the same error when reproducing.

Does anyone know of any Emacs configuration or variables that will fix this issue? I cannot seem to find any information online nor any hints from the docs that would help me solve this problem. There also doesn't appear to be an existing bug on this issue.

Kind regards,

James

Build:

In GNU Emacs 29.3 (build 2, x86_64-w64-mingw32) of 2024-03-24 built on
AVALON
Windowing system distributor 'Microsoft Corp.', version 10.0.22631
System Description: Microsoft Windows 10 Pro (v10.0.2009.22631.3737)

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)

Important settings:
value of $LANG: ENG
locale-coding-system: cp1252

Major mode: Eshell

Minor modes in effect:
shell-dirtrack-mode: t
eshell-prompt-mode: t
eshell-hist-mode: t
eshell-pred-mode: t
eshell-cmpl-mode: t
eshell-proc-mode: t
eshell-arg-mode: t
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date cl-seq
em-unix em-term term shell subr-x ehelp em-script em-prompt em-ls
em-hist em-pred em-glob em-extpipe em-cmpl em-dirs esh-var pcomplete
comint ansi-osc ansi-color ring em-basic em-banner em-alias esh-mode
eshell esh-cmd generator cl-loaddefs cl-lib esh-ext esh-opt esh-proc
esh-io esh-arg esh-module esh-groups esh-util files-x rmc iso-transl
tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel dos-w32 ls-lisp disp-table
term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 77916 10347)
(symbols 48 7258 0)
(strings 32 22552 1535)
(string-bytes 1 692077)
(vectors 16 14796)
(vector-slots 8 338764 15212)
(floats 8 41 32)
(intervals 56 355 0)
(buffers 984 11))

[-- Attachment #2: Type: text/html, Size: 9995 bytes --]

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

end of thread, other threads:[~2024-07-08 11:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-19 15:53 bug#71655: Eshell external commands do not work under GNU Emacs for Windows James Hilling via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-19 19:12 ` Eli Zaretskii
2024-06-19 19:22   ` Eli Zaretskii
2024-06-19 19:40     ` Jim Porter
2024-06-20  4:53       ` Eli Zaretskii
2024-06-20  5:34         ` Jim Porter
2024-06-20  7:45           ` Eli Zaretskii
2024-06-22 19:55             ` Jim Porter
2024-06-23  4:36               ` Eli Zaretskii
2024-06-24  1:40                 ` Jim Porter
2024-06-24  5:56                   ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-08  3:26                     ` Jim Porter
2024-07-08 11:09                       ` Eli Zaretskii
2024-06-19 19:30   ` 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).