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.

Make non-fullscreen apps possible

See original GitHub issue

What I’m Looking For

I’m interested in drawing controls over the current terminal, instead of switching away to a completely different screen.

What I’ve Tried

I’ve tried just about everything I can think of, but I always end up with a terminal full of blue. I’m on Windows 10, .NET 4.7.1.

  • Creating a new Toplevel with a frame of 100x1 and using that with Application.Run
  • I thought maybe the Init() call was goofing me up, so I tried subclassing Toplevel and setting those values myself, then using that subclass with Application.Run<T> to use the Func<Toplevel> overload of Application.Init
  • A variety of Window or Toplevel instances that set the bounds smaller than the terminal extents

I didn’t see anything in the docs or any Google results or any Stack Overflow tags. Am I just missing it? Or is this not supported? (If not, I can fill out an enhancement issue 😁)

Thanks!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:5
  • Comments:14

github_iconTop GitHub Comments

3reactions
migueldeicazacommented, Jan 24, 2021

What we could do is ensure that the Toplevel only takes over a part of the screen, and that it does not go beyond it - at least this should be possible on Windows. To complete the story, we could retrieve the contents of the screen and store them while we run and restore them on exit.

This gave me the idea: instead of making the code work with a subset of the screen, we could have a “PreviousScreenshotView” that is a view that gets loaded with the original contents - this would allow for example to have views that can change size, windows popup and other things, without having to worry about not touching something in particular.

On shut down, this view could repaint the original contents.

This on Windows should be pretty easy.

For Unix, I never thought this could be possible, but then I remembered that in xterm and newer terminals there is a way of retrieving the contents of the terminal. This is what various test-suites use to validate that terminals use.

While this would be limited to xterm-like terminals, I think Windows + xterm should cover pretty much anything out there. The only Unix challenge would be to precisely map the previous screen attributes to ncurses attributes, but that is a minor problem.

1reaction
tthierycommented, May 26, 2022

I would love using a terminal roughly like that …

$ cat log.log
A
B
C
D
E
$ dotnet run app-with-gui.cs
==================================================================
| What is your favourite color: _Purple__________                |
| What is your favourite pet:   _Dog_____________                |
| [Save] [Cancel]                                                |
==================================================================
$ wc Program.cs
234134

I tried Specte.Console as an alternative but that library is not supporting multi-widget re-rendering and is more focused on outputting information. I want to use one of the two libraries to built a console UI for a work item library.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to prevent an application from running in fullscreen ...
Open Control Panel / Ease of Access Center / Make the Mouse easier to use. Place a check mark in the Prevent Windows...
Read more >
How to Force Games Into Windowed Mode on Windows 10 ...
Try pressing the Alt + Enter hotkey when you're playing in full-screen gaming mode. This hotkey might activate a windowed mode when pressed; ......
Read more >
Programs and Apps always open in full screen mode.
To program a windows to open where you want it, open and drag it to the position and size you want, then click...
Read more >
How to Make Any App or Game Go Full Screen in Windows
The easiest way to go full screen in an application or a game is to use the Alt + Enter keyboard shortcut. This...
Read more >
How to switch between non-fullscreen apps with trackpad ...
Swipe down with four fingers and you'll see all open windows, then select the app you want. https://support.apple.com/en-us/HT204895. If I need ...
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