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

OCGV: Move "Set cursor key to application mode" fix to gui.cs #99

Open
tig opened this issue May 13, 2020 · 18 comments
Open

OCGV: Move "Set cursor key to application mode" fix to gui.cs #99

tig opened this issue May 13, 2020 · 18 comments

Comments

@tig
Copy link
Contributor

@tig tig commented May 13, 2020

// By emitting this, we fix an issue where arrow keys don't work in the console

I think this may be a bug that impacts all gui.cs apps and should be fixed there. However, I don't fully understand what the user impact of the bug described in these comments was and how setting the cursor key to application mode fixed it. Can you provide more detail?

As an aside, IIRC, Dispose for a Cmdlet is not actually guaranteed to get called until the CmdLet's module is unloaded. And that does NOT happen immediately after the Cmdlet is run. This Dispose gets called in OutConsoleGridviewCmdletCommand's Dispose. In building out-winprint I discovered that I could not count on Dispose for timely cleanup and instead had to do stuff at the end of EndProcessing. This is another reason I think this logic should be moved to gui.cs (unless I'm wrong about the fact the underlying bug impacts all gui.cs apps).

@tig tig changed the title Move "Set cursor key to application mode" fix to gui.cs [OCGV] Move "Set cursor key to application mode" fix to gui.cs May 13, 2020
@tig tig changed the title [OCGV] Move "Set cursor key to application mode" fix to gui.cs OCGV: Move "Set cursor key to application mode" fix to gui.cs May 13, 2020
@TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented May 13, 2020

Yeah I needed to bring it over to gui.cs but it was easier to just "fix it here"

@tig
Copy link
Contributor Author

@tig tig commented May 13, 2020

Thanks. I'm confused though. Why is this needed? Why is it needed AT EXIT?

@tig
Copy link
Contributor Author

@tig tig commented May 13, 2020

#49

I bet this is a non-Windows issue, right? Because if I comment out that line I can't repro #49 on Windows...

@TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented May 13, 2020

Very possible.

@TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented May 13, 2020

btw if you ever need a cheap linux environment https://shell.azure.com is a great testing ground for OCGV behavior.

@tig
Copy link
Contributor Author

@tig tig commented May 13, 2020

Thanks. I actually use that (and WSL) here and there. The real problem is my dev skillz are barely adequate on Windows, and just getting started being able to enlist and build GraphicalTools on Linux is a bit much for me right now. I'm capable, it's just time.

@tig
Copy link
Contributor Author

@tig tig commented May 14, 2020

@TylerLeonhardt I got PS working on WSL and am sooo close. However, I can't figure out how to install dotnet core 3.1.102 on Ubuntu because the latest RPM installs 3.1.202. When I do invoke-build build I get this:

image

If I change global.json to specify 3.1.202 I get this:

image

Any pointers appreciated. Sorry for posting here, but figured it'd be the best way to ask you.

@TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented May 14, 2020

That second error is random and not our fault. Can you run it again?

@tig
Copy link
Contributor Author

@tig tig commented May 14, 2020

Different machine, same result. I've run it a dozen times. Has anyone else successfully built GraphicalTools on linux using dotnetcore 3.1.202 by changing global.json as:

{
    "sdk": {
        "version": "3.1.202"
    }
}
@TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented May 14, 2020

from your first screenshot it looks like you need to install zlib

@tig
Copy link
Contributor Author

@tig tig commented May 14, 2020

from your first screenshot it looks like you need to install zlib

Nope, zlib is installed (via https://www.systutorials.com/how-to-install-the-zlib-library-in-ubuntu/). That was what I first tried. I believe this error is due to the fact I don't have donnetcore 3.1.102 installed. Because I can't easily install it. Because it's been superseded by 3.1.202.

image

I believe this because if I change global.json to require 3.1.202 the build actually progresses way past that point, but fails with that weird C:\Microsoft\Xamarin\Nuget error.

@TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented May 14, 2020

can you delete the .dotnet in GraphicalTools and try the build again?

@tig
Copy link
Contributor Author

@tig tig commented May 14, 2020

That was it. Thanks!

Woot!

image

@TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented May 14, 2020

@TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented May 14, 2020

You've got that issue in gui.cs open now - can we close this one?

@tig
Copy link
Contributor Author

@tig tig commented May 15, 2020

It's not fixed here until it's fixed there. Isn't it best practice to leave the issue open until there's a PR that fixes the issue (in this case, deletes the code from Dispose)? That PR can't happen until there's a build of gui.cs that def fixes the issue.

@tig
Copy link
Contributor Author

@tig tig commented May 15, 2020

@TylerLeonhardt Can you please comment out this fix and see if you can reproduce this? I cannot get this to reproduce on Linux under WSL. I've tried with both Windows Terminal and the WSL terminal. I don't have a mac to test on. I've double checked that I'm using my build of ocgv with that line commented out and that I did NOT fix it in gui.cs yet ;-).

I can't move this to gui.cs until I have a repro...

@TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented May 19, 2020

Yeah I can't repro anymore. That's interesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.