Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Ability to run a shell command inside flow #67

Open
VisenDev opened this issue Nov 19, 2024 · 8 comments
Open

Feature Request: Ability to run a shell command inside flow #67

VisenDev opened this issue Nov 19, 2024 · 8 comments
Labels
enhancement New feature or request
Milestone

Comments

@VisenDev
Copy link
Contributor

Similar to :! in vim or alt-! in emacs

@neurocyte neurocyte added the enhancement New feature or request label Nov 19, 2024
@neurocyte
Copy link
Owner

I usually do this sort of thing with my terminal emulator or terminal multiplexer. I'm not sure what practical value it has these days when nearly every terminal has splits and/or tabs and key bindings to run commands. If you want something to drive a repl I think perhaps a plugin of some sort might be a better way to go.

@VisenDev
Copy link
Contributor Author

perhaps, I usually only use a single terminal pane so sometimes it is convenient to be able to quickly run a command from my editor

@neurocyte
Copy link
Owner

Would you want to have the command output sent to an editor buffer? Or have flow suspend itself and hand over the tty? Flow doesn't support any kind of job control atm, so this could be a lot more complicated than it might seem. Stdio should be pretty simple though.

@VisenDev
Copy link
Contributor Author

Would you want to have the command output sent to an editor buffer? Or have flow suspend itself and hand over the tty? Flow doesn't support any kind of job control atm, so this could be a lot more complicated than it might seem. Stdio should be pretty simple though.

My initial thought would be that suspending temporarily should be the most robust because then you can take advantage of the terminal emulator's builtin escape code processing. Sending output to a buffer is not important

We don't need to support anything fancy. For more complex terminal tasks, I agree using a tab is better - but for a really quick git status check and similar things, it is convenient

@neurocyte
Copy link
Owner

The shell command should include a way to send the current selection (or word-at-cursor) to the shell command and also a way to specify that the output should be sent to a new buffer (and allow specifying the language). See #88 for a possible use case.

@VisenDev
Copy link
Contributor Author

The shell command should include a way to send the current selection (or word-at-cursor) to the shell command and also a way to specify that the output should be sent to a new buffer (and allow specifying the language). See #88 for a possible use case.

Expanding on this - if it would be possible to keep the shell command running in the background and periodically send that shell command new input - that would also more or less address #68

@neurocyte neurocyte added this to the v0.3.0 milestone Dec 21, 2024
neurocyte added a commit that referenced this issue Jan 7, 2025
@neurocyte
Copy link
Owner

neurocyte commented Jan 7, 2025

I've added the ability to bind keys to shell commands. The output will be placed in the current buffer. Bin create_scratch_buffer first to put the output in a scratch buffer. See flow.json for examples.

The second part will be a mini-mode or palette to input commands to be run. Possibly with history fuzzy search.

@neurocyte
Copy link
Owner

The mini-mode and palette are now added. Still working on a few minor bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants