Skip to content
TheChatArchiveThe Chat Archive
Geminigemini-2.5-pro· GoogleHugging Face LMArena Human Preference 140K

yazi on windows shell echo "test" returns process exited with status code 1

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with chatgpt-4o-latest-20250326’s answer.
  1. User

    yazi on windows shell echo "test" returns process exited with status code 1

  2. Gemini Assistant

    Of course! This is a very common issue for new yazi users on Windows.

    The error process exited with status code 1 when running a simple command like echo "test" almost certainly means that Yazi is configured to use the wrong shell for your Windows environment.

    The Problem Explained

    By default, Yazi's configuration is often geared towards Linux or macOS systems, which use shells like bash or zsh. To run an external command (like echo), Yazi tries to execute it using a command like:

    sh -c "echo 'test'"
    

    On a standard Windows installation, there is no sh.exe in your system's PATH. When Yazi tries to find and run sh, the operating system can't find it, and the process fails immediately, returning a generic error code (status 1).

    The Solution: Configure Yazi to Use a Windows Shell

    You need to tell Yazi to use either PowerShell (recommended) or the classic Command Prompt (cmd.exe). You do this by editing your yazi.toml configuration file.


    Step 1: Find or Create Your yazi.toml File

    Your Yazi configuration files are located in the Windows AppData directory. You can paste this path directly into your File Explorer's address bar:

    %APPDATA%\yazi\config\
    

    Inside that folder, look for a file named yazi.toml.

    • If it exists, open it with a text editor.
    • If it does not exist, create a new text file and name it yazi.toml.

    Step 2: Add the Shell Configuration

    Add the following lines to your yazi.toml file. You have two main options.


    Option A: Use PowerShell (Recommended)

    PowerShell is the modern, powerful shell for Windows and is the best choice for most users.

    Open your yazi.toml and add this block:

    [manager]
    shell = ["powershell", "-c"]
    

    Explanation:

    • shell = [...]: This tells Yazi which program to use to execute commands.
    • "powershell": The command to run PowerShell.
    • "-c": This is the flag for PowerShell that means "execute the following command string."

    Option B: Use Command Prompt (cmd.exe)

    If you prefer the classic Command Prompt, you can use this configuration instead.

    Open your yazi.toml and add this block:

    [manager]
    shell = ["cmd", "/c"]
    

    Explanation:

    • "cmd": The command to run the Command Prompt.
    • "/c": This is the flag for cmd.exe that means "Carries out the command specified by the string and then terminates." (Note the forward slash / instead of a dash -).

    Step 3: Save and Restart

    1. Save the yazi.toml file.
    2. Completely close your terminal and Yazi.
    3. Re-open Yazi.

    Now, when you press : to enter a command and type echo "test", it should work correctly and you will see "test" printed at the bottom of the screen with process exited with status code 0 (which means success).

    Summary

    The issue is that Yazi doesn't know it needs to use a Windows-specific shell. By creating a yazi.toml file at %APPDATA%\yazi\config\yazi.toml and adding one of the following snippets, you fix the problem.

    For PowerShell (recommended):

    [manager]
    shell = ["powershell", "-c"]
    

    For Command Prompt:

    [manager]
    shell = ["cmd", "/c"]
    

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.