Giter VIP home page Giter VIP logo

bashbook's Introduction

Hi there 👋

I am a software engineer who codes only by voice. I spend my spare hours building open source tools primarily for voice control, like Cursorless. Besides programming I have a passion for audio and sound reproduction which led me to develop my own digital sound processor, WinDSP, that has been the brain of my home theatre system for years.

If you like to talk about voice control, join Talon slack and if you like to support my work, please consider sponsoring me 😊

bashbook's People

Contributors

andreasarvidsson avatar trace-andreason avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bashbook's Issues

Match styling of output to text output

The styling used by the bashbook default cell output doesn't quite match the way VSCode renders text output by default. The default text output is more compact, and I'd argue we should probably do our best to match it. Here are a couple of screenshots:

Text output:
image

Bashbook xterm output
image

Looks like:

  • Bashbook has more padding at top
  • Bashbook has less padding at left
  • Bashbook font is bigger
  • Slight colour difference?
  • Kerning difference?

Here's the relevant dev tools info for text output:

.monaco-workbench .notebookOverlay .output>div.foreground .output-plaintext, .monaco-workbench .notebookOverlay .output>div.foreground .output-stream {
    font-family: var(--notebook-cell-output-font-family);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.monaco-workbench .notebookOverlay .output {
    position: absolute;
    height: 0;
    font-size: var(--notebook-cell-output-font-size);
    user-select: text;
    -webkit-user-select: text;
    -ms-user-select: text;
    cursor: auto;
    box-sizing: border-box;
    z-index: var(--z-index-notebook-output);
}

image
image

Add bash "profiles"

Handling of implementation details for other shells other then default bash. For example updating paths for git bash.

Auto-completion on empty line is extremely slow on MacOS

Takes about 10 seconds. Which basically makes it unusable for retrieving a recent command, where on regular bash I can just press up arrow. Might also consider supporting up arrow / ctrl-p; not sure how hard that would be

Fill width of notebook

  • Rather than fixed width
  • This is what VSCode does with their terminal, so hopefully we can do it too

Syntax for navigating to workspace

The same way as ~/ we'll give you the user home directory we could add some syntax that refers to the current workspace. Would be an variable set by vscode

Improve ansiRegex

A regular expression for ansi control characters is used to strip these to turn the data returned from node-pty into plaintext. Is used both for the plain text output and for the output variables.

Create new Bash Notebook command broken

Issue Type: Bug

I tried to run the "BashBook: Create new Bash Notebook" (bashbook.newNotebook) command, and got the following error message:

image

Extension version: 0.0.1
VS Code version: Code 1.63.2 (899d46d82c4c95423fb7e10e68eba52050e30ba3, 2021-12-15T09:37:28.172Z)
OS version: Darwin x64 21.2.0
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2300)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 32.00GB (0.02GB free)
Process Argv --crash-reporter-id 99d35f96-61a9-461b-a60d-f915d32f3eee
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30384386
pythondataviewer:30285071
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
vscop804cf:30404767
vscop453:30404998
vsrem710cf:30416617
vsccppwtstudy:30421978

Support path autocomplete

  • On linux, could potentially look at /proc/<pid>/cwd to figure out current path? Not sure whether this picks up changes to working directory or just ones it started with; not sure how to make cross platform

Support variable autocomplete

  • On linux, could potentially look at /proc/<pid>/environ? Not sure whether this picks up new variables or just ones it started with; not sure how to make cross platform

Extension Not Working Generally

I am Running ubuntu 22.04 with visual studio code installed through apt as the read me says. I have restarted visual studio code but I continued to get the error that there is no extension associated with the file type .bashbook. The command to generate a new bash book file also seems to be missing. I have attached images here. I'm not sure if I'm doing something wrong

thank you for your work
image
image

Add support for mac and linux

Because of node-pty we have to have platform specific binaries.

I have already tried publishing it with different targets, but currently only the windows binary works on the marketplace.
"vscode:publish": "vsce publish --target win32-x64 linux-x64 darwin-x64 darwin-arm64"

  • mac
  • linux

Prompt replacement

For now just a code lens with working directory, relativized to parent of workspace root if contained in workspace.

If we wanted to get fancy, but probably won't work

Basically a little webview at the top with things like current working directory, etc.

If easier markdown cell is prob fine for a start

Customisable would be nice but can cross that bridge when we get there

Add mouse interaction

  • Copy text on selection
  • Paste on right click
  • Use clipboard in vscode

I'm currently having issues with building vscode using webpack into the renderer and is therefore using clipboardy for the clipboard. This should change to native vscode.

Broken height computation

Current height computation just counts newlines. Better to detect if there are any fancy control characters, and if so just bail out and render full height

Goal: simplest possible solution where the failure mode is that it's too tall. As long as height is fine for majority of simple commands it's fine

Example that breaks: fzf

Clean up vsce package

I went to install bashbook locally, but noticed a bunch of warnings. Would be good to address these:

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  renderer.js (346 KiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  main (346 KiB)
      renderer.js


WARNING in webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

webpack 5.65.0 compiled with 3 warnings in 6487 ms
 WARNING  A 'repository' field is missing from the 'package.json' manifest file.

Support keypresses

Forward them to nodepty from onkeypress

Questions

Will VSCode trap them, esp things like ctrl-c?

Support unicode

Swedish unicode characters åäö is not correctly rendered

Figure out what todo with working directory

The behavior used for jupyter notebooks is that when you create a new untitled notebook the current working directory is the project root. For a notebook that has a position in the file system the working directory is its parent. If you are not in a project and it's an untitled notebook then it just uses the root of your file system

Support auto completions for bash history expansions

It would be useful if bashbook had completions for the built-in bash history expansions.
For example, if you type !$ and then trigger autocomplete, it will just replace it with last arg to last command.

See the manual for a full list of such expansions, but at the very least it would be great to support the following:

  • !! for last command
  • !!:n for nth arg of last command
  • !!:$ or !$ for last arg to last command
  • !-n to refer to command n lines back
  • !-n:$ to refer to last argument to command n lines back
  • !-m:n to refer to nth argument to command m lines back

I use these all the time in the shell, so it would be really nice to be able to map voice commands like "last final" that would hit !$ then trigger autocomplete and I'd just be left with the last argument to the last command

History view

It would be nice to have a way to view the current virtual terminal session as if it were run command-by-command in a terminal.

I think you could basically store the full (or truncated) output history of the bash you're running, including control codes, and then render it in an xterm when requested

Support multiple simultaneous bash engines

  • Eg notebook could have metadata saying “shared”, “per cell”, or “never”
  • And then a cell could have metadata saying “shell name”
  • So if the notebook is “shared”, then there would be a default shell that they all use, but if any cell specifies a shell id in its metadata, that shell will be used, creating a new one if necessary
  • think about interaction with #3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.