-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add run-shell-command for Commands #1682
Conversation
Co-authored-by: Blaž Hrastnik <[email protected]>
I was hoping something like this would come around. Is it possible to scroll the output with keys? |
Now the
Or add a new component that can scroll. |
Popup is the correct component to use, it has a set_position function that can be used to place it somewhere else than the cursor. |
It would also be nice if you can have an option where no output is there. To run the command in the background |
To suppress the output, you can redirect to Also, I noticed that running shell ( To run time-consuming tasks in the background, it would be better to fix the freezing problem. |
Why not run the shell commands in a seperate thread? |
Asynchronous shell execution is not so tough with |
helix-term/src/commands.rs
Outdated
cx.editor.set_error("Command failed"); | ||
} | ||
|
||
if !output.is_empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we don't show anything if there is no output? How does user know if it finished running?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the shell command is executed synchronously, the user will know it's finished when it releases from the freeze.
I think it's one way to display a message like "Command successes" in the status area if success
.
helix-view/src/info.rs
Outdated
text, | ||
width: body.lines().map(|l| l.width()).max().unwrap() as u16, | ||
height: body.lines().count() as u16, | ||
text: body, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text: body, | |
text, |
Using text here is clearer I think? But probably need to change the above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
But the information is now displayed in Popup
, should I revert info.rs
change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey is this going into the main branch any time soon?
Sorry for the late response. |
cool |
Can't it be merged now? |
I'm just trying Helix for the first time right now so there's a lot I don't know and terminology I'm probably wrong about, but... here are my general desires around this. I would like a new pane/split within the current window to open, connected to the streaming IO for the process (or at least the output). Basically, I want this to feel more like Vim's Here are a couple other use cases for asynchronous shell commands in the editor that come to mind, though the list could be nearly endless.
I think there's a lot of potential here. I especially love the dropdown/ups for auto-completion being prevalent, but I get the sense that a lot of these features need some UX work and polish. I hope this is helpful. |
@nixpulvis I know it's not really what you might be looking for here, but maybe you could try using https://zellij.dev/ ? I find it very very good and easy to use. |
I added a command to run a shell command as discussed in #1541.
Just running, no piping, no inserting/appending
Output is displayed in the info area.
_d_helix.2022-02-20.14-34-08_Trim.mp4