Open neqs20 opened 4 years ago
Terminal UI aside, it would be nice to have proper Command/Process API that supported things like piping and what not.
@jonbonazza That's definitely for a separate proposal :slightly_smiling_face:
Wow, I just thought about this and found your Reddit post on the research. Thanks a lot for proposing this, and of course the development. I absolutely support this and hope, it becomes some standard in the editor. A bit a naive question:
Is it not possible to simply embedded the library of a fully functional multi-platform terminal, like libtmt?
I found another library, that seems very useful for this project. It is maintained by Jupyter, the guys from which the popular "Jupyter Notebooks" come from. So very well maintained and programmed. It seems documentation is also laid out to be helpful for people in our situation.
I would also like to add another thing: This could be way more, than just a helpful terminal at the bottom.
Putting it as a replacement for the scripting editor, could it help to facilitate the usage of programming languages, who are supported by the engine, but not by the build in editor.
Simply loading Neovim, Emacs or another terminal based editor, and eventually even integrating them via an own "settings" section, and so on, could greatly improve the user experience within Godot.
Describe the project you are working on:
Godot Editor
Describe the problem or limitation you are having in your project:
When working on your project you usually use a terminal for all kinds of tasks (e.g. git, searching for files or in my case - compaling GDNative plugin). This requires you to switch between multiple windows and that takes a bit of the time.
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
There could be a terminal interface integrated into editor that could save a lot of time. It would be similar to the Visual Studio Code one but simpler. Here's a screenshot of it:![screenshot](https://user-images.githubusercontent.com/38013155/90313615-3500c300-df0e-11ea-983f-9be9fc2deca5.png)
Godot's terminal would include:
We also need to make sure that it's cross-platform. This feature targets OSX, Linux and Windows platforms.
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
I faced some limitations while imlementing this feature with EditorPlugin:
OS.execute
implementation spawns new process every time you use it. See Egzample 1Egzample 1 What do I mean by "spawns new process"? Take a look at this code:
Even though I changed directory to Desktop where my batch script resides I can't run it. That's because
OS.execute
doesn't behave like one terminal. Every time we try to run commands one after another we wait for the first one to finish and then read the output. After it's done the process is terminated and then the nextOS.execute
call is run.To fix this we can chain commands together in one
OS.execute
call with a composite command:It's not that straightforward as it seems but pretty doable.
Egzample 2
To execute commands terminal needs some sort of input box or input element. It also needs to output information. Terminals that we use combain those two elements into one:![Example](https://user-images.githubusercontent.com/38013155/90316734-7a2fef80-df24-11ea-9ddd-7c5d8dbc1e79.png)
Output is a part of terminal's text which should never be overwrttien by the user. Input on the other hand is a part that user needs to control.
When a user issues the command it becomes part of the output.
I had troubles with that approch so I came up with a simpler design:
As you can see the terminal consists of 3 parts:
Note that it's really simple prototype created with EditorPlugin just to showcase this feature.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
I belive many people will use this feature. Definitely can't be worked around with few lines of code.
Is there a reason why this should be core and not an add-on in the asset library?:
There are 3 ways to add this:
I think the feature would benefit a lot if it was made as a part of the editor code.
Additional information:
All of this was tested in Godot 3.2.3 and Windows 10 version 2004