The shell runs what it reads, not what a name ends in

A typed word had ".sbx" pasted on the end of it before anything went
looking, which is why "notes.txt" sent the shell after a notes.txt.sbx
that was never going to exist, and why a script could only be started
with "do". The extension was what made a file reachable by name.

Now the word as typed is asked for first and the word with the extension
on it only after that misses. What comes back is dispatched on what is
inside it: SBEX loads and starts, "#!" is read as lines. The loader
already refuses anything that is not SBEX and the script reader already
refuses anything without the shebang, so the two kinds of runnable file
turn each other away and neither has to know the other exists.

The suffix can only ever be a second guess, so a file that is really
there always beats one that would have to be invented and every program
already on a disk still starts by the short name people type for it. It
costs a second walk of each directory when a word is not found in it.

Tab completion offers a file under the name it actually has, and the
suffix stripper is gone: a first word can now be any file at all, and
offering only the ones ending .sbx would hide the scripts.

The video capture windows moved out a hundred thousand cycles, because
starting Lander now walks four names where it walked two.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
Anachronaut
2026-09-06 13:23:14 -04:00
co-authored by Claude Opus 5
parent 4e61158b11
commit fd962f0084
7 changed files with 203 additions and 121 deletions
+16 -4
View File
@@ -11,15 +11,27 @@ finished
> dir
Say.sbx 156
dir.sbx 156
Greet 156
notes.txt 21
notes.sbx 21
4 files
hello.sh 38
Apps <dir>
6 files, 1 directory
> Greet a program with no extension
it says: a program with no extension
finished
> hello.sh
> echo a script, started by its name
a script, started by its name
> away.sh
> echo a script from the system place
a script from the system place
> notes
not a program
that is not a program or a script: notes
> notes.sbx
not a program
that is not a program or a script: notes.sbx
> notes.txt
I do not know: notes.txt
that is not a program or a script: notes.txt
> nosuchprogram
I do not know: nosuchprogram
> abcdefghijklmnopqr