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.

Impossible to create a custom ConsoleDriver

See original GitHub issue

Hello guys, currently I need 24 bit color support for my console application.

In the past there was an attempt to bring this feature to Terminal.Gui (see pull #103). But the code never get into the main branch.

So I thought I can just create my own ConsoleDriver with the source provided there and use the Application.Init to serve my class. However, this is impossible.

Although the abstract base class ConsoleDriver is public, you cannot derive it from outside the library because the Contents field is defined as internal abstract.

Moreover there are several such things where classes and field are defined internal making them inaccessible from outside.

To name some of them:

  • internal class NetDriver
  • internal class WindowsDriver
  • internal static View Application.mouseGrabView
  • internal static View Application.wantContinuousButtonPressedView

Due to the internality of the Application fields which also used by the ConsoleDriver you get a second level of restriction which makes the whole thing unusable outside.

I would like to appreciate if the internal fields get defined as public as most as possible. So everyone who wants a custom implementation of a class can access the required structures. This would also improve feature testing and development outside the library more convenience.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

4reactions
BDispcommented, Jun 12, 2022

With the PR #1770 is now possible to create a custom ConsoleDriver that can enjoy all the Terminal.Gui features. I think this issue can be closed.

3reactions
migueldeicazacommented, Feb 28, 2022

Hello,

Generally I dislike exposing internal details because it ties our hands in the future.

I much rather incorporate true-color support directly into the library, which achieves the stated goal, but also gives us the freedom to change the internals in the future, without breaking any existing code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Impossible to create a custom ConsoleDriver · Issue #1620 · gui- ...
With the PR #1770 is now possible to create a custom ConsoleDriver that can enjoy all the Terminal.Gui features. I think this issue...
Read more >
T
Gui development by creating an account on GitHub. ... Creates a instance of <see cref="Terminal.Gui. ... Gui application (<see cref="ConsoleDriver.Rows"/>).
Read more >
Booting linux kernel using a simple char driver as console?
And the answer appears to be you can't. A work around might be to create a custom initramfs that changes the /dev/console device...
Read more >
VGA and NTSC tiled color text console driver - Parallax Forums
I have completed a VGA text console driver, including a (hard to ... To make a custom font, create an 8x1024 pixel image...
Read more >
How to run custom kernel and initrd in UEFI?
Side question: if I boot with my own linux kernel but the custom initrd , I can launch my program but can't interact...
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