wavetermdev / waveterm

An open-source, cross-platform terminal for seamless workflows
https://www.waveterm.dev
Apache License 2.0
4.37k stars 112 forks source link

Editable Command Blocks #415

Open reform-chipper opened 8 months ago

reform-chipper commented 8 months ago

I'd like to be able to edit a command block and execute it again, analogically to how Jupyter Notebooks work.

Examples of what could this enable:

Simple example of this vision:

image

All related issues:

https://github.com/wavetermdev/waveterm/issues/415 - Editable Command Blocks https://github.com/wavetermdev/waveterm/issues/416 - Command Block Reordering https://github.com/wavetermdev/waveterm/issues/417 - Editable Markdown Blocks https://github.com/wavetermdev/waveterm/issues/418 - Export/Import Tab or Workspace https://github.com/wavetermdev/waveterm/issues/419 - Allow All Blocks in a Tab To Be Executed Again https://github.com/wavetermdev/waveterm/issues/420 - Allow Tab or Workspace Shell to be Restarted https://github.com/wavetermdev/waveterm/issues/421 - Undo for Deleting a Command Block

sawka commented 7 months ago

Makes sense. We'd probably have to clear the output in this case. So it would become almost like editing "history".

I'll have to think about all of your enhancements together. I'm not sure if a new "mode" is needed to support workbook like flows or if it is possible to hack it on to the existing in-sequence terminal model. There are a lot of very specific things that I'd want to be able to do in "workbook" mode that don't make sense for normal terminal mode.

reform-chipper commented 7 months ago

I think the output doesn't have to be the cleared if you make it obvious to the user it's outdated (if the command block has been edited).

For me it would be great to not have a separate mode for this. I want to be able to just use Wave to tweak and execute my commands, take some notes in between them, and have a notebook I can come back to later as a byproduct.

AFAIK there really isn't something like it at the moment. You either have a dumb interactive terminal, or you have something like Runme notebooks or Jupyter with bash_kernel, where you get no interactivity at all. Thus the workflow always ends up being "work in the terminal, then remember to paste stuff that works into the static thing and hope you haven't forgotten an env variable or something". Over the years, I've developed a strong hatred for this process.

I understand designing this is a hard UI problem and I don't have all the answers. Even if it doesn't work out, Wave is already an improvement over my old way of doing things. Thanks for all the work on the project!

carvinlo commented 1 month ago

Just like the workflow of Warp?

image
reform-chipper commented 1 month ago

I don't know Warp, but based on your screenshot it looks like something different. I should be able to edit any cell and run it again. Your example looks like it only works for "workflows"?