BashBook
Notebook for running bash/shell script

Creating a BashBook
BashBook the way you would any normal notebook
- Open a file with the
.bashbook extension
- New File... /
Bash Notebook
- Command /
BashBook: Create new Bash Notebook
Commands
- Create new Bash Notebook
- Open notebook as markdown
- Open all outputs in new file
- Execute cell and select content
- Execute cell and clear content
- Execute and show output in below markdown cell
- Clear cell content and edit
- Copy cell output
- Open cell output in new file
Details
One shell per notebook
Each notebook is running one continuous shell. This means that commands running in one cell will effect the others. Only one execution is allowed at the time and the rest is queued.
Interactive terminal (prompt)
Interaction with running execution is possible in the output terminal. Finished executions are non-interactive.

Resize
- Resizes terminal height to fit content dynamically
- Resizes terminal width at end of execution. Only affects next execution.
Current Working Directory(CWD)
Tries to set CWD in following order
- File directory
- Workspace directory
- User home directory
Problems
"Timeout waiting for custom prompt"
BashBook sets PS1 to detect when the shell is ready for the next command which signals end of cell execution. Prompt systems that override PS1 from .bashrc or PROMPT_COMMAND can break execution. Common examples are starship, ble.sh, bash-preexec, custom PROMPT_COMMAND hooks, and similar prompt theming tools. If you see the error message Cannot open resource with notebook editor or if commands do not start or finish correctly, try disabling those prompt customizations for the BashBook shell session.
"Cannot open resource with notebook editor"
On a Ubuntu/Debian system you may get a Cannot open resource with notebook editor error if vscode is installed as a flatpack(Ubuntu Software). For BashBook to work correctly vscode needs to be installed with apt install
Build details
Build local
npm install
# Run after each install
npm run rebuild
npm run compile
# Build `.vsix` file
npm run package
Dependencies
Due to node-pty we have platform specific dependencies
node-pty dependencies
Components
Rebuild node-pty with correct electron version
If you get an error NODE_MODULE_VERSION mismatch.
- Check the version of electron vscode is using.
Help => About => Electron
- Make sure you have the correct version of electron in
package.json. List of electron versions is available here
- Run
npm run rebuild