Nucleus icon indicating copy to clipboard operation
Nucleus copied to clipboard

[FEATURE] Internal Terminal Support

Open mellobacon opened this issue 3 years ago • 23 comments

Is your feature request related to a problem? Please describe. Currently I am focused on adding external terminal support while I did research on how to make it internal. An external terminal seems fine for the time being but eventually an internal editor will be done instead

Describe the solution you'd like Add internal terminal support to replace the external terminal feature. This will be as a panel below the editor

Additional context After some research, this can be done via xterm + nodepty. The xterm code has been in place for a bit so all is needed is to add nodepty once panels are implemented.

mellobacon avatar Oct 22 '22 04:10 mellobacon

lesgo

lyntier avatar Oct 22 '22 22:10 lyntier

Gonna keep an eye on how this is implemented for a personal project.

Moosems avatar Jul 16 '23 01:07 Moosems

I could give this a try, I haven't done anything of such in the past but, I think I might have a way to work around it

opeolluwa avatar Jul 25 '23 15:07 opeolluwa

I might recommend against xterm so as to make it work better across systems (if Nucleus even works across multiple OS's).

Moosems avatar Jul 25 '23 17:07 Moosems

Tell me more,

opeolluwa avatar Jul 25 '23 17:07 opeolluwa

Well you could spawn a subprocess of an actual shell instance so it's much less emulation and more just making a widget to properly interact with it. Of course hooking up the subprocess is goin got take a little bit of tinkering but generally integrated terminals take a bit of time to perfect and make nice. Plus, putting in all the OS specific commands is difficult and terminal apps like nano use visuals so that's also a struggle.

Moosems avatar Jul 25 '23 17:07 Moosems

I got that, I'd look into it, let's see what I can come up with.

opeolluwa avatar Jul 25 '23 17:07 opeolluwa

So I have found a terminal repo for reference on how to connect xterm to the app. It uses Rust which I'm not too familiar with so I don't understand the code 100% but from my testing it seems to work fine. https://github.com/marc2332/tauri-terminal

mellobacon avatar Jul 25 '23 18:07 mellobacon

I might recommend against xterm so as to make it work better across systems (if Nucleus even works across multiple OS's). @Moosems I thought xterm could be ok since Visual Studio Code uses xterm as well and since that is also cross platform. I do plan on having Nucleus work on multiple OSes in the future but my priority it Windows for now until Nucleus is further a long.

mellobacon avatar Jul 25 '23 18:07 mellobacon

Sounds good :).

Moosems avatar Jul 25 '23 18:07 Moosems

Sounds good :).

Yeah 👍

opeolluwa avatar Jul 25 '23 18:07 opeolluwa

I'd see what I can make of it

opeolluwa avatar Jul 25 '23 18:07 opeolluwa

I might recommend against xterm so as to make it work better across systems (if Nucleus even works across multiple OS's).

From experience, edge cases pop up in building cross-platform applications, I know this from building https://github.com/opeolluwa/wishare-app I'm quite certain the way to go is to plan it all together from scratch. Besides, about 3 of every 5 developers uses a Unix based system

opeolluwa avatar Jul 25 '23 18:07 opeolluwa

I don't know how VS Code did it because I used VS Code long before I ever installed xterm.

Moosems avatar Jul 25 '23 18:07 Moosems

I don't know how VS Code did it because I used VS Code long before I ever installed xterm.

It could be that they built the sources of xterm with Vscode

opeolluwa avatar Jul 25 '23 18:07 opeolluwa

Oh it uses xterm source code.

Moosems avatar Jul 25 '23 18:07 Moosems

Oh it uses xterm source code.

I'm not certain, but it could be

opeolluwa avatar Jul 25 '23 18:07 opeolluwa

https://github.com/xtermjs/xterm.js

Moosems avatar Jul 25 '23 19:07 Moosems

Great! Guess what's left is implementation

opeolluwa avatar Jul 25 '23 19:07 opeolluwa

Hi @mellobacon do you still want me to look into the implementation? Or @kamadoori would take it up since he's already assigned

opeolluwa avatar Aug 02 '23 06:08 opeolluwa

@opeolluwa Go ahead! @kamadoori (Forgot you were still assigned lol) do you want to work on this still or nah?

mellobacon avatar Aug 02 '23 20:08 mellobacon

@opeolluwa I'll go ahead an assign you for the time being

mellobacon avatar Aug 02 '23 20:08 mellobacon

I went ahead and made a terminal feature branch for easier testing since I imagine this will take a while to get working. So far I have a button you press from the status bar that should pop open a terminal panel on the bottom similar to how vscode has it. From my testing it sort of works but there are issues with the terminal not sizing correctly in the container. Plus apparently it has trouble with multiple terminals being open at once. So if you guys are still interested you can work on it from here and push to dev once everything is figured out @opeolluwa @kamadoori

mellobacon avatar Nov 14 '23 00:11 mellobacon