-
-
Notifications
You must be signed in to change notification settings - Fork 163
How Interactive Shells Work
andychu edited this page Mar 11, 2020
·
19 revisions
- Back to Interactive Shell (a page of ideas)
Let's figure out how interactive shells work! bash, zsh, fish, and Oil are significantly difference.
- The prompt.
- In POSIX shell this is
$PS1
and$PS2
. - bash has extensions.
- Does a shell have to know how wide the prompt is to draw correctly? (note: this depends on unicode chars in the propmt)
- In POSIX shell this is
- Shell Autocompletion -- when you hit TAB, what happens
- Autosuggestions -- does it display suggestions on the prompt line automatically? That is, there is no prompting.
- Spell correct? zsh has this I think.
- History. What format is the history stored in?
- in bash it's a text file, which gives it an odd "two level store" behavior: see issue 324
- It uses GNU Readline. bash and readline are maintained together.
- TODO: What are the common plugins and what do they expect from the shell?
Features
- autosuggestions
- TODO: is there a "main loop" ?
Oil is mostly bash-like now. I added a zsh-like completion interface that doesn't scroll every time you hit TAB, but it has some bugs, like #257.