How to get a "terminal view"?
See original GitHub issueIs there a simple way to have an embedded terminal like view?
My goal is to have a console app with multiple panes. One for input commands, one for command outputs, and one for logs. It’ll also have more to GUI, but the whole premise stems from input coming from console-like string commands. e.g. User types text, a “process command” event fires when return input is sent, this event then parses and validates command, etc…
Maybe it’s best described visually, so here is how my GUI looks currently: image
I wonder if there is already a solution available I could use.
Currently I am trying to accomplish this by extending from TextView because I couldn’t find any examples of such a thing.
I wonder if I’m misunderstanding something, or how nobody (based off what I could find on the web) has seemed to require something like this ? I have simple functionality where I create a class inheriting from TextView, and override ProcessKey
and do various things to sort of get the desired functionality, but I can see it’s probably not leading towards a robust solution.
I recently found out about xTermSharp’s TerminalView
, I think it could maybe be what I’m looking for? Unfortunately I couldn’t get it working. The readme states:
In addition, a complete Xterm/Vt100 terminal emulator that you can embed is now part of XtermSharp - you just need to pull TerminalView.cs into your project.
But to my understanding, because TerminalView.cs relies on XtermSharp, I pull that too right? In my case I cloned the whole repo and tried building and running the GuiCsHost project. I fixed a bit of the errors related to syntax changes that weren’t updated yet (that file seems a bit undermaintained), so I got it to build but now at runtime I’m facing even more errors which are leading me to believe I’m doing it wrong, e.g.
System.DllNotFoundException: ‘Unable to load DLL ‘libpty.dylib’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)’
at this line.
So before I go further with this I’d like to know, is this TerminalView
usable at the moment and could I use it for these purposes?
I thought I’d ask this, and hope to get some clarification as to whether to try getting TerminalView
to work in my project, or try extending TextView, or to not bother completely (e.g. if I misunderstand and gui.cs is not meant for this purpose)?
I apologize for my lack of understanding, I’m just not entirely sure if my use case is a good candidate for all of these tools.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:25
Top GitHub Comments
The XtermSharp-based TerminalView has not been updated in a while, but it should not be hard to update.
It provides a pseudo-terminal and emulation of a VT100/Xterm terminal in a view, and you can either feed terminal data manually, or you can connect it directly to a subprocess that will run for you.
This is different than command line parsing which you alluded in another post.
@bureto I already finished my PR #1385 where the
DesiredCursorVisibility
on theTextView
had been fixed. It also was added others features likeEnable
property and the eventsCanFocusChanged
,EnableChanged
and theVisibleChanged
. TheFileDialog
was also improved.