←  cshw: The C Shell for Windows

Chapter 2

Installing cshw and Starting Your First Shell

In This Chapter

This chapter is mostly clicking, copying, and confirming. By the end of it, you'll have a working cshw on your machine and a prompt in front of you. Let's go.


What You Need Before You Start

The list is short:


Step 1: Get the cshw Binary

Download the latest cshw release. You'll end up with a file called something like cshw.exe (or a small .zip that contains it). Put it somewhere you can find it — your Downloads folder is fine for now; we'll move it to a permanent home in a minute.

WARNING

cshw alpha builds are Authenticode-signed with Tropibyte's own self-signed certificate, which Windows does not trust. SmartScreen will say "Windows protected your PC" and report an unrecognized app, and the warning will not go away on its own — it is not a reputation delay. Before you click "More info" → "Run anyway", check that the file's SHA-256 hash matches the one published in the release notes (Get-FileHash cshw-setup-*.exe).


Step 2: Choose Where to Install

You have two reasonable options:

The cshw install command can do either one. Which one it picks depends on whether you ran it from an elevated (Administrator) shell.


Step 3: Run install

Open cshw.exe by double-clicking it. You'll see the startup banner, followed by a prompt:

C Shell for Windows
Copyright (C) 2024-2026 Tropibyte, Inc.  All rights reserved.
CSHW C:\Users\YourName\Downloads >

That's cshw introducing itself. The prompt shows the shell's name (CSHW), the current working directory, and a > for you to type after. If that format looks familiar, it should — prompt in cshw uses the same $-code mini-language as Windows cmd.exe, so $P is the current path, $G is the >, $T is the time, and so on. If you're an old hand at customizing the cmd prompt, you already know how to customize cshw's. (Chapter 7 covers the language properly.)

cshw hasn't been added to your PATH yet, so this is the only way to launch it for the moment. To fix that, type:

install

That's the entire command. cshw will:

If you want to force a per-user install even from an elevated shell:

install /user

Or to install to a specific folder:

install C:\Tools\cshw

TIP

If install reports that it added a directory to your PATH, you'll need to open a new shell window for that change to take effect. PATH updates don't propagate to already-running processes.


Step 4: Verify the Install

Close the cshw window. Open a fresh Command Prompt (or another cshw, or PowerShell — anything will do) and type:

cshw

A new shell window should open with the banner and prompt. To check the version once you're inside, type:

version

You should see something like:

C Shell for Windows version 1.0.8.4

The shorter alias ver works the same way.

REMEMBER

This book is written against cshw 1.0.8.4. If your ver reports something older, everything here still applies, but some of the newer material — concurrent pipelines, the server daemons in the later chapters, the == rule in Chapter 9 — may be missing or behave differently. Grab the current release if you want to follow along exactly.

REMEMBER

cshw's native option style is the csh one: bare command names (version, ver) and forward-slash switches (/user, /w, /k). That's how csh and tcsh have always done it, and it avoids -- colliding with negative numbers in arithmetic. You'll see this convention everywhere in cshw.

Two GNU-style flags work anyway, on every built-in, because they are what people type first:

dir /?           dir --help          both print dir's usage
dir --version    cshw --version      both print the version

Earlier printings of this book said neither of those worked. They do now — the shell answers both centrally rather than leaving each of 245 commands to implement them, or not.

If cshw reports "is not recognized as an internal or external command," the PATH didn't update. Either log out and back in, or open a brand-new shell window. (Some Windows versions are stubborn about PATH updates; a reboot, while annoying, always works.)


Step 5: Launch cshw and Look Around

Once you've got a fresh cshw running, try a few quick commands to feel things out:

TRY IT

Type say os and press Enter. cshw should print something like Windows 11 (10.0.26100). Now try say sysstats for a composite snapshot of your system. Welcome to the shell.

echo Hello, world
pwd
say os
say sysstats
whoami

What each one does:

TECHNICAL STUFF

say also stashes its result in the special variable $result, which means you can use it in scripts: set ver = `say version` captures the cshw version into a variable. We'll get to backtick command substitution in Chapter 5.


Where Your Config Lives

cshw has two kinds of config — a startup script (your aliases, procedures, prompt, environment) and a settings file (durable knobs like history size and editor preferences). They're separate by design.

Startup script. cshw looks for one in two places, in order:

If either file exists, cshw will read it on startup and execute its contents. That's where you put your aliases, custom prompt, environment variable defaults, and any procedures or libraries you want available every session.

Settings file. cshw also reads a settings.csh file holding declarative settings, with the lookup order settings.csh → HKCU registry → HKLM registry → built-in defaults. The first match wins; you only need to write the keys you want to override. This is where things like history length, default text editor, and similar knobs live — values cshw needs to know before your .cshrc even runs. A settings.csh.example ships with the installer; copy it next to your config when you want to override a default.

Don't worry about creating either file yet — we'll come back to .cshrc throughout the book, and settings.csh only comes up when you want to change a built-in default. If you don't have either, cshw starts with sensible defaults and that's perfectly fine.

REMEMBER

Your command history lives at %APPDATA%\cshw\history. It persists across sessions, so the up-arrow tomorrow will recall the things you typed today.


A Quick Word About Running as Administrator

Sooner or later you'll need to do something privileged — install a service, edit a protected registry key, modify a file in C:\Windows. cshw includes a sudo command for exactly that, and it works the way Unix users expect:

sudo regedit
sudo /w notepad C:\Windows\System32\drivers\etc\hosts

The first command launches regedit elevated. The second opens Notepad as administrator with /w (wait) so the shell pauses until you close it.

cshw goes one step further than most shells with sudo /system, which runs a command as NT AUTHORITY\SYSTEM — a privilege level above administrator that even admin shells normally can't reach. It's implemented through a one-shot scheduled task, triggers a single UAC prompt, and is genuinely useful for things like reading the SAM hive or inspecting SYSTEM-only privileges.

WARNING

sudo /system is a sharp tool. SYSTEM-level privilege can do irreversible damage to your installation. Use it only when you know exactly what you're doing, and don't pipe its output the normal way — output isn't captured, so redirect inside the elevated command (sudo /system whoami /priv > C:\out.txt).

For the full treatment — the elevation model, sudo /system, the wait (/w) and no-wait behavior, and every caveat — type man sudo at the prompt. For now, just know it's there.


If Something Goes Wrong

Most install hiccups fall into one of these buckets:

If none of those apply, the man pages and the project documentation are the next stop. Type help at any prompt for the list of built-in commands, or help <command> for usage on a specific one. There's also man <command> for the full manual page when one is available.


Onward

You have cshw installed. You have a prompt. You're ready for the actual fun part. Chapter 3 is your first hands-on tour: the dozen or so commands that get you 80% of the way to being productive at the shell. Roll up your sleeves.