Interactive use and configuration
winzsh starts in interactive mode when both standard input and output are connected to a console. You can recall commands from the current session's history.
Keyboard shortcuts
| Key | Action |
|---|---|
| ← / →, Home / End | Move the cursor within the input line. |
| ↑ / ↓ | Recall the previous or next history entry. |
| Tab | Complete a command name or path. At the end of a line, include history matches. Press repeatedly to cycle through the options. |
| Ctrl+C | Cancel the line you're editing. When an external command is running, Windows handles the console event; winzsh returns to the prompt when the command exits. |
| Ctrl+D or Ctrl+Z | Exit the shell when pressed on an empty line. |
For example, after running cargo test --locked --all-targets, type cargo test --l and press Tab to complete the command from history. Tab doesn't run it: you can edit it further or press Enter to run it.
Matching command names and paths come first, followed by history entries from this session, newest first. A history entry must start with the exact text you've entered up to the cursor, including case, spaces, and quotes. On an empty or whitespace-only line, or when the cursor is in the middle of a line, Tab only offers regular completion.
Save your settings for future sessions
Try alias ll='ls' at the prompt, then save it in %USERPROFILE%\.winzshrc as shown below. The next time you start an interactive session, ll will list files.
# %USERPROFILE%\.winzshrc
alias ll='ls'
export EDITOR=notepad.exe
winzsh reads the startup file only if USERPROFILE is an absolute path. It does not fall back to a .winzshrc in the working directory. To start without loading your settings, use winzsh --no-rc.
Customize the prompt
The default prompt shows the working directory. Your home directory (the nonempty value of $HOME, or %USERPROFILE% otherwise) appears as ~ in the prompt, but pwd still prints the full path.
Long paths and custom prompts wrap to fit the terminal. If the prompt fills the line, you can type at the start of the next line. Visual line breaks are not part of the command or its history entry.
The default prompt shows the working directory in Soft Teal and the trailing > in Amber. It does not change the background or command output colors. To turn off the default colors, add this line to .winzshrc:
export NO_COLOR=1
To show fixed text instead of the working directory, set PROMPT. A trailing space helps separate the prompt from the command you type.
export PROMPT="winzsh> "
PROMPT also accepts ANSI SGR styling. For example, export PROMPT='\e[1;32mwinzsh> \e[0m' explicitly sets bold green. NO_COLOR does not affect this styling. The shell does not apply control sequences other than SGR.
Show the current directory or Git branch with zprompt.exe
To use zprompt.exe from your PATH, add this line to .winzshrc:
export PROMPT_COMMAND=zprompt.exe
winzsh searches only absolute directories in PATH when you specify a name. To pin the location, use an absolute path such as export PROMPT_COMMAND="${USERPROFILE}\.bin\zprompt.exe". The value identifies one executable, not a shell command line.
winzsh runs the executable with no arguments for each new input line, so specify a file you trust. It displays the UTF-8 standard output with trailing newlines removed. It falls back to the fixed PROMPT or the default prompt if the program fails, produces no output, takes more than one second after launch, writes more than 16 KiB, or leaves a descendant holding the output pipe open. winzsh also terminates any remaining descendants, so don't use the prompt to launch background services. To turn off the dynamic prompt for the current session, run unset PROMPT_COMMAND.