bun icon indicating copy to clipboard operation
bun copied to clipboard

bun repl

Open DetachHead opened this issue 3 years ago • 7 comments

What is the problem this feature will solve?

want to be able to quickly run a code snippet without creating a file

What is the feature you are proposing to solve the problem?

bun repl command, or even just bun on its own opens the repl (like in node)

(i know this is is mentioned in #159 but it didn't have its own issue. feel free to close if you don't want seperate issues for items on the roadmap)

What alternatives have you considered?

No response

DetachHead avatar Aug 01 '22 08:08 DetachHead

Literally one of the 2 things I need to replace node with bun. This is an image in material icons.

Pedromdsn avatar Oct 03 '22 03:10 Pedromdsn

If that ever happens, would it be possible to add an option for the bun repl to:

  1. Use GNU readline (used by bash, gdb and others) while having access to completions.
  2. Have an option to open the repl in our preferred $EDITOR buffer. For example oh-my-zsh has an option to open the zsh command line in a vim buffer
  3. Have a full fledge vim mode such zsh and fish have

Any combination of those solutions would make a repl much more usable than they generally are.

rlwrap does exist but then you lose completions, tough choice to make

cassepipe avatar Feb 17 '23 16:02 cassepipe

It's supported now with bun repl? I don't see any way to enable vi bindings though; it doesn't seem to use readline

veilm avatar Sep 26 '23 13:09 veilm

Hello, Any news on this ? Thanks

KaKi87 avatar Feb 01 '24 18:02 KaKi87

its been on my mind recently to rewrite bun repl in native code (it is currently an alias to bun x bun-repl which is written in javascript)

Use GNU readline (used by bash, gdb and others) while having access to completions.

in my opinion readline shouldnt be used because completions ought to be powered by the javascript engine, and i just think that the act of reading input can be implemented about a thousand times better.

Have an option to open the repl in our preferred $EDITOR buffer.

I think this is a reasonable idea, but it borders on the point that you may just want to use an actual file with bun run.

I don't see any way to enable vi bindings though

this would be interesting to support

paperclover avatar Feb 01 '24 18:02 paperclover

Using GNU readline would have the advantage of unlocking a vim mode (that's not the best around but hey it's there for us who really enjoy vim modes in line editors)

cassepipe avatar Feb 08 '24 18:02 cassepipe