Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSYS2_shell.cmd file not launching #3102

Closed
goyalyashpal opened this issue Jul 21, 2022 · 16 comments
Closed

MSYS2_shell.cmd file not launching #3102

goyalyashpal opened this issue Jul 21, 2022 · 16 comments

Comments

@goyalyashpal
Copy link

goyalyashpal commented Jul 21, 2022

Update: 2023-01-24 This issue is resolved. So, i will be self hiding all the non-essential comments of mine.
Go to #3102 (comment) for some more details.

  • .cmd scripts have to run with cmd shell
  • .cmd scripts run with the shell defined in ComSpec in environment variable,
  • i.e. there's no shebang or file association stuff used there
    (wow, unix was truly wayyyy ahead of MS at that time, i wonder why it didn't get that popular?? 🤔)

So, for .cmd scripts to work on double clicking, it has to have this value: COMSPEC=C:\WINDOWS\system32\cmd.exe

  • check in environment variables or run env | grep COMSPEC

Describe the issue

MSYS2 MSYS or any other launchers (i.e. those 4 shortcuts to C:\msys64\msys2_shell.cmd with different arguments) thereof doesnt launch.

Old description (modified)
Redundant verbosity

Steps to Reproduce the Problem

  1. Press win & type MSYS
  2. Click on any of "MSYS2 MSYS" or "MSYS2 MINGW"

Now: (from some months) Some window seems to flash and disappear, nothing visible and persistent seems to happen.
Earlier: It used to launch the terminal window.

Update: it had nothing to do with updates

Additional Context:

  • my msys2 has pro'lly never been fully upgraded since 2021-December, so, it is pending upgrades of 162 packages (241 MiB download size)
  • but I thought to file this before updating in case some useful info can be dug up via this
  • is there any particular package which requires updating for this to be fixed?

Duplicate search: msys not launching

Screenshots etc not needed any more

Screenshots:

Msys.Not.Launching.Vwcpxmnzgu-1.mp4

Environment

  • OS: Windows 10 Home Single Language version 20H2 64bit
  • '...'
@goyalyashpal goyalyashpal changed the title MSYS not launching MSYS2 not launching Jul 21, 2022
@goyalyashpal

This comment was marked as outdated.

@goyalyashpal
Copy link
Author

goyalyashpal commented Jul 27, 2022

This problem persists even after doing core and full system upgrade of msys2
ref: #3093 (comment)

@goyalyashpal

This comment was marked as resolved.

@goyalyashpal

This comment was marked as outdated.

@sskras
Copy link

sskras commented Oct 26, 2022

It would be nice, there are only 3 open issues here at the moment:

image

@goyalyashpal goyalyashpal closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2022
@goyalyashpal

This comment was marked as resolved.

@Biswa96
Copy link
Member

Biswa96 commented Dec 31, 2022

Try a clean install with latest installer. Need more info to understand the issue. Make sure things are not deleted or modified by antivirus software. Check if the launchers are working e.g. mingw64.exe etc.

@goyalyashpal
Copy link
Author

goyalyashpal commented Dec 31, 2022

Check if the launchers are working: [C:\msys64]
mingw64.exe
msys2.exe
ucrt64.exe
clang64

yes, they're working:

image

@Biswa96
Copy link
Member

Biswa96 commented Dec 31, 2022

What command did you run with that msys2_shell.cmd and in which shell?

@goyalyashpal
Copy link
Author

goyalyashpal commented Dec 31, 2022

What command did you run with that msys2_shell.cmd and in which shell?

i manually launched the launchers' exe-s from C:/msys64

@goyalyashpal
Copy link
Author

Found a maybe related pull: msys2/msys2-installer#50

@goyalyashpal

This comment was marked as resolved.

@goyalyashpal
Copy link
Author

goyalyashpal commented Jan 24, 2023

so, i tried running the script from an already running cmd shell, and surprisingly, it ran successfully as well 😵

$ cd /c/msys64
$ cmd
C:\msys64>

And all of the following commands worked i.e. launched the mintty with $MSYSTEM defined

Ref:

msys2_shell.cmd script with various arguments
msys2_shell.cmd
msys2_shell.cmd -msys
msys2_shell.cmd -ucrt64
msys2_shell.cmd -clang64
msys2_shell.cmd -clangarm64
msys2_shell.cmd -clang32
msys2_shell.cmd -mingw64
msys2_shell.cmd -ming32

So, the error seems to be in running the script file from explorer i guess?

@goyalyashpal
Copy link
Author

goyalyashpal commented Jan 24, 2023

What command did you run with that msys2_shell.cmd and in which shell?

now it seems to make sense 😅

i am guessing that

  • those script files when opened from explorer
    (in any way: right click context menu, or double click, or shortcut - which includes shortcut from start menu as well)
  • ... it is not opening with required stuff, i.e. it is not getting cmd there
  • but i don't see how I can change which program it opens with, like i don't see any "open with" menu item on right clicking on it, i don't see any such thing in the properties panel either....

@goyalyashpal
Copy link
Author

goyalyashpal commented Jan 24, 2023

i don't see how I can change which program it opens with

yeah.... i found it. So,

  • it turns out that the running shell used for .cmd scripts too depend on the ComSpec system variable,
  • which i had redefined with value bash.exe for my windows user account
  • from there, rest is pretty self explanatory: the script runs with bash, which returns an error, the terminal disappears.
ComSpec=C:\msys64\usr\bin\bash.exe

so, this was caused by same reason as: wez/wezterm#2909

@goyalyashpal
Copy link
Author

goyalyashpal commented Jan 24, 2023

Found a maybe related pull: msys2/msys2-installer#50
- #3102 (comment)

oh and yeah, this above related pull from '22-09-04 release tag of msys2-installer, was really related to this issue. brilliant.

having .exe installers elevates from this dependence on the ComSpec environment variable, so that the user can freely use the bash as default at system level if per so wishes to.

nice.

@goyalyashpal goyalyashpal changed the title MSYS2 not launching MSYS2_shell.cmd not launching Jan 24, 2023
@goyalyashpal goyalyashpal changed the title MSYS2_shell.cmd not launching MSYS2_shell.cmd file not launching Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants