Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SystemConsole (aka NetDriver) appears to have broke #518

Closed
tig opened this issue May 23, 2020 · 6 comments
Closed

SystemConsole (aka NetDriver) appears to have broke #518

tig opened this issue May 23, 2020 · 6 comments
Labels

Comments

@tig
Copy link
Collaborator

tig commented May 23, 2020

I figured I'd write a Scenario to illustrate Application.UseSystemConsole = true;

I immediately discovered I had to change how Scenario.Init, .Setup, and .Run worked. Which I did.

Then I couldn't figure out why I was getting weird behavior and crashes.

So I modified demo.c to Application.UseSystemConsole = true; and ran it.

Crashed on startup.

I don't have time to look at this now, but from what I can see nobody's been testing SystemConsole for a while and it's quite broken...

@tig tig added the bug label May 23, 2020
@BDisp
Copy link
Collaborator

BDisp commented May 23, 2020

SystemConsole does not support the gui. It is as if you are writing characters directly on the console. So this just uses the OS's default console.

@tig
Copy link
Collaborator Author

tig commented May 23, 2020

Oh. I thought it worked for gui, but just didn't support mouse.

@BDisp
Copy link
Collaborator

BDisp commented May 23, 2020

I tested it once and nothing works, at least I got this impression that made me think right away, why use this option if it doesn't work lol

@tig tig changed the title SystemConsole appears to have broke SystemConsole (aka NetDriver) appears to have broke May 23, 2020
@tig
Copy link
Collaborator Author

tig commented May 23, 2020

To be clear, UseSystemConsole means the NetConsole will be used. Just so we're talking about the same thing:

		static void Init (Func<Toplevel> topLevelFactory)
		{
			if (_initialized) return;

			var p = Environment.OSVersion.Platform;
			Mono.Terminal.IMainLoopDriver mainLoopDriver;

			if (UseSystemConsole) {
				mainLoopDriver = new Mono.Terminal.NetMainLoop ();
				Driver = new NetDriver ();
			} else if (p == PlatformID.Win32NT || p == PlatformID.Win32S || p == PlatformID.Win32Windows) {
				var windowsDriver = new WindowsDriver ();
				mainLoopDriver = windowsDriver;
				Driver = windowsDriver;
			} else {
				mainLoopDriver = new Mono.Terminal.UnixMainLoop ();
				Driver = new CursesDriver ();
			}
			Driver.Init (TerminalResized);
			MainLoop = new Mono.Terminal.MainLoop (mainLoopDriver);
			SynchronizationContext.SetSynchronizationContext (new MainLoopSyncContext (MainLoop));
			Top = topLevelFactory ();
			Current = Top;
			CurrentView = Top;
			_initialized = true;
		}

Here are related Issues:

I'll stop now and get back to something important.

@BDisp
Copy link
Collaborator

BDisp commented May 23, 2020

Of course we are talking about the same thing. But at the time I tested NetMainLoop, it was not and is not as developed as WindowsDriver and CursesDriver, so as I couldn't get it to work properly, I gave up and never looked at it again. This observation of yours, perhaps will enliven some work on it, who knows, if it is worth it.

BDisp added a commit to BDisp/Terminal.Gui that referenced this issue May 27, 2020
tig added a commit that referenced this issue May 27, 2020
@tig tig added the 1.0 label Jun 4, 2020
@tig
Copy link
Collaborator Author

tig commented Sep 28, 2020

I'm trying to get a list of bugs that must be fixed for 1.0. I don't think anyone uses SystemConsole and thus would recommend we don't mark this as 1.0. Any objections?

@tig tig added this to the v1.0 milestone Sep 28, 2020
BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Nov 17, 2020
tig added a commit that referenced this issue Nov 18, 2020
Trying fixing #518. Almost functions work on both Windows and Unix with the NetDriver.
@tig tig closed this as completed in 9dacb7d Dec 12, 2020
tig added a commit that referenced this issue Dec 12, 2020
Fixes #518. Added mouse support for the NetDriver.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants