question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to get a "terminal view"?

See original GitHub issue

Is 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:25

github_iconTop GitHub Comments

2reactions
migueldeicazacommented, Aug 3, 2021

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.

1reaction
BDispcommented, Aug 2, 2021

@bureto I already finished my PR #1385 where the DesiredCursorVisibility on the TextView had been fixed. It also was added others features like Enable property and the events CanFocusChanged, EnableChanged and the VisibleChanged. The FileDialog was also improved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Open or quit Terminal on Mac
In the Finder , open the /Applications/Utilities folder, then double-click Terminal. Quit Terminal. In the Terminal app on your Mac, choose Terminal >...
Read more >
Integrated Terminal in Visual Studio Code
From the menu, use the Terminal > New Terminal or View > Terminal menu commands. From the Command Palette (Ctrl+Shift+P), use the View:...
Read more >
9 ways to open the Windows Terminal - Digital Citizen
In Windows 11, click the Search icon and then type “terminal” or “windows terminal.” Press Enter on your keyboard when you see the...
Read more >
A Quick Guide to Using Command Line (Terminal)
Click on “Accessories” and you'll find the Command Prompt shortcut. Right click on the shortcut and press “Run as Administrator”. Accessing ...
Read more >
Terminal | ChromeOS for developers
Right-click the Terminal icon and select “Settings” from the menu. Appearance and themes. You can customize the way the Terminal looks to fit...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found