-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Work-In-Progress: Integrated Terminal ⚙ #14664
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
base: master
Are you sure you want to change the base?
Conversation
|
I also was thinking about whether a |
all views are splittable: https://github.com/helix-editor/helix/blob/master/docs%2Farchitecture.md, so yeah it makes sense |
It makes sense to me, but a lot of the |
|
I have a genuine question. What are the benefits of integrating a terminal into Helix? When you can take advantage of the multiplexer that several terminals offer, or even tmux helix.mp4 |
That's a fine question. The main benefit for me is windows support. Zellij and tmux don't support windows (except in WSL). Also, having the terminal integrated allows us to do some cool stuff in the future like CTRL+Clicking a file link in an failed compilation to go to the file, line and col that the error references. |
7c48a01 to
f7cd3b4
Compare
029ec3f to
c17950f
Compare
|
I don't think this makes sense or is needed |
c17950f to
9080cc5
Compare
There has historically been an interest in this feature, as can be found here. I also have been interested in this feature for a while, so I decided to do some work to adapt the original PoC. |
|
I'd love to have "clickable" (by keyboard) file links! |
what do you think about making but I'm afraid this will touch a lot of code, so it's better as a separate PR because for example, plugins may one day want to support views that aren't attached to a document |
Also, some ideas on what to do about all the code that expects a view to always have a document would be nice. There are several macros that are used all around helix that would have to be updated. What's the cleanest way to decouple all this? cc: @the-mikedavis Also worth considering is a generic of some kind. I think the problem with traits is that if we don't redo the order of things (aka a document has a view, not the other way around), we end up with functions on the view that aren't usable without downcasting. |
9080cc5 to
df9ddca
Compare
|
I can vouch for the Windows support. I have been stuck on Windows due to a multitude of reasons, but an issue I kept facing is a toggleable terminal. Wezterm does handle most of my multiplexing needs, aside from a popup terminal, or a toggleable terminal. I will try to get this running on my fork maybe this week, I have way too much PRs merged there 😅 |
If you bring it in as-is, just a reminder you'll need to set the Also there are rendering glitches and stuff, but please don't hesitate to provide feedback! :) |
4002219 to
242ca5e
Compare
|
there's a plugin for this already at https://github.com/mattwparas/steel-pty, might be worth checking out |
242ca5e to
9e26f9f
Compare
3f93917 to
652c1e9
Compare
|
I'm to the point in developing this where I feel like I need some direction from the maintainers, on whether this is actually wanted. If so, there are some design details we have to hash out. I don't want to put more work into this for nothing, if it won't get accepted upstream. I don't particularly care about the plugin branch, nor do I want to use plugins. I prefer stock Helix. It wouldn't be the end of the world for me if this were not something wanted in Helix though. I'd probably just gravitate toward an editor that has an integrated terminal. If we do want this upstream, the big question that would guide the direction of this PR is how we should present the terminal to the user?
There's also smaller details like how we want the UX to look for handling multiple terminals, modes for the terminal (INS, NOR, etc) and other stuff. In order to make this PR actually appealing to upstream, I need to know these things before I put more work into it. Thanks! :) |
|
I think you'll need to be a bit more patient on this. You might want to chat them up on matrix, there's higher chance of getting a response there.
I think the bottom half placement is not a bad idea. A seperate PR can deal with other augmentations.
|
|
I don't have the review bandwidth for a change of this size, especially with the current size of the backlog. I'm also not super attached to the feature - I was not a huge fan of the embedded terminal in Vim and it brings in a lot of deps and changes. It may be better for the terminal to start as a plugin and become a core piece in the long run. So I'm not saying no to this feature out-right, just that I won't be able to commit the necessary effort to reviewing or guiding it any time in the near future. |
|
I think the right way to do this is to integrate libghostty instead. There are so many details when it comes to implementing a fully compliant terminal. Even neovim devs plan to switch to libghostty in the future. |
Until there is an actual rust crate that integrates this (from what I can tell libghostty isn't even released yet), there's nothing actionable with that.
|
|
See what zed did with integrated alacritty |
|
Building helix would also then require a zig compiler if it depended on libghostty. Thats a pretty substantial thing to add, with zig not being even 1.0 yet. |
652c1e9 to
5a73d9a
Compare
This commit separates some primitives from `helix-view` into their own crates, for later use by crates that view might depend on, without causing cyclic dependencies.
This commit adds the `helix-integrated-terminal` crate, which handles the PTY creation and view logic for an integrated terminal in Helix, using the `alacritty_terminal` crate. The terminal can be opened using the `:term` command, and the terminal can be exited by either using `exit` in the terminal itself, or by using `C-q` twice. The current implementation is as a pop-up, but in the future, we may be able to expose the terminal as a `View`, if work is done to decouple the `Document` attachment to `View`. Signed-off-by: Ryan Brue <[email protected]>
5a73d9a to
c2b2ef4
Compare



This PR is a work-in-progress! Give it a whirl if you feel adventurous ;)
Resolves: #1976
This PR was inspired by the discussion in the issue above.
Why an integrated terminal? Why not Tmux/Zellij/?
Progress so far:
Screencast_20251026_224808.webm
What's left to work on?
helix-integrated-terminalto use (so helix-view doesn't have a cyclic dependency onhelix-integrated-terminalView(hard)Feel free to contribute to the branch!