This is a common point of confusion when working with environments like MSYS2 and Git Bash on Windows. The core reason lies in how these environments emulate a POSIX (Unix-like) system on top of the native Windows operating system, and how their specific process listing tools (ps) are implemented.
Here's a breakdown:
Windows Process Model: At its heart, Windows manages all running applications as Windows processes. Each process has a unique Process ID (PID), runs under a specific user context, and interacts with the Windows kernel. Whether started from cmd.exe, PowerShell, Git Bash, MSYS2, or a native Windows GUI application, they are all fundamentally Windows processes.
MSYS2 and Git Bash as Emulation Layers:
MSYS2 (Minimal SYStem 2) is a software distribution and building platform that provides a POSIX-like shell environment (Bash) and a collection of GNU utilities and libraries. It's built using the MinGW-w64 toolchain.
Git Bash is essentially a self-contained package that includes a Bash shell, Git, and a set of common Unix utilities (like ls, grep, find, and ps) all compiled using MinGW-w64.
These environments do not run a separate operating system. Instead, they provide a compatibility layer that translates POSIX system calls (like fork, exec, ps) into their corresponding Windows API calls.
The ps Command is a Ported Utility:
The ps command you're using within MSYS2 or Git Bash is not the native Linux ps. It's a version of ps that has been compiled for Windows using the MinGW-w64 toolchain.
This ported ps command needs to interact with the Windows process management APIs to discover and list processes.
Why You Can't See Everything:
Scope of the ps Port: The MinGW-w64-ported ps command is designed to be Unix-like and is often more effective at seeing processes that are also part of the POSIX-like environment (i.e., other MSYS2/Git Bash processes, or applications that behave in a "Unix-like" manner).
Abstraction and Filtering: The translation from POSIX ps calls to Windows API calls might involve some level of abstraction or filtering. The ported ps might not be designed to enumerate every single Windows process in the same comprehensive way that native Windows tools do. It might have a narrower view or be tuned to look for specific types of process behaviors that align with the POSIX emulation.
Internal Implementations: While both Git Bash and MSYS2 use MinGW-w64, they might bundle slightly different versions of utilities or have subtle differences in their runtime libraries. This could lead to minor variations in how their ps commands interact with the Windows process table. However, the fundamental limitation of not seeing all Windows processes is common to both.
"Same Account" vs. "Same Environment": You are logged in as the same user, so it's not a permission issue between users. The limitation is about the perspective and capabilities of the ps tool running within the MSYS2/Git Bash environment versus the perspective of a native Windows process manager.
What Tools Will Show All Processes?
To see all processes running on your Windows system, regardless of how they were started, you should use native Windows tools:
Task Manager: The most common graphical tool. Go to the "Processes" or "Details" tab.
tasklist command: Available in cmd.exe and PowerShell.
bash
# In cmd.exe or PowerShell
tasklist
PowerShell's Get-Process cmdlet:
powershell
# In PowerShell
Get-Process
These native Windows tools directly query the Windows process management APIs and provide a complete, system-wide view.