When using Yazi — a terminal file manager — on Windows, and notice that running something like:
echo "test"
inside Yazi's shell returns:
Process exited with status code 1
even though the command seems correct, this is likely related to one of the following issues:
✅ 1. Shell Configuration in Yazi
Yazi uses a shell to execute commands (for example, when you press : and run a command), and the default shell it uses might not be Windows CMD or PowerShell, or it's not correctly configured.
✅ Fix:
Set the shell Yazi should use correctly in the ~/.config/yazi/yazi.toml (or equivalent config) file.
For Windows PowerShell:
[shell]
program = "powershell"
args = ["-NoLogo", "-Command"]
Or for CMD:
[shell]
program = "cmd"
args = ["/C"]
Or for a Unix-like shell (like Git Bash or WSL), adapt accordingly.
✅ 2. Shlex Parsing / Quoting Issues
Yazi might not properly parse the Windows command syntax depending on the shell. For instance, this:
echo "test"
might work in Bash, but behave differently in CMD or PowerShell.
Try instead:
echo test
Or use single quotes (sometimes parsing gets confused):
echo 'test'
✅ 3. Workaround Using Scripting
If echo keeps returning status code 1, test with another command like:
dir
or
Get-ChildItem
To see if only echo is broken or the shell integration itself.
✅ 4. Use External Terminal to Test
Try launching an external terminal (CMD, PowerShell, etc) and run:
echo "test"
echo %errorlevel%
Or in PowerShell:
echo "test"
echo $LASTEXITCODE
To confirm if the exit behavior is specific to Yazi or your shell itself.
✅ 5. Process Exit 1 with Echo is (Sometimes) Harmless
Some versions of PowerShell and CMD can return exit code 1 on certain commands even if they succeed visually — not all commands return code 0 unless explicitly handled.
If echo outputs correctly, the "status code 1" could be non-critical. Still, Yazi displays it because it’s indicative of non-zero exit.
✅ Summary / Fix
- Set Yazi to use your correct shell via
yazi.toml
- Ensure arguments (
args) are passed based on the shell (powershell ≠ cmd)
- Use simpler or alternative commands to test
- Ignore status code if output is correct, or trap proper exit codes in scripts
Example: Full yazi.toml for PowerShell
[shell]
program = "powershell"
args = ["-NoLogo", "-Command"]
Then inside Yazi, try:
echo test
Let me know what shell you're using, and I can tailor the config directly.