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

Reported incompatibility with GNU Octave #17054

Open
DHowett opened this issue Apr 12, 2024 · 8 comments
Open

Reported incompatibility with GNU Octave #17054

DHowett opened this issue Apr 12, 2024 · 8 comments
Labels
Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Milestone

Comments

@DHowett
Copy link
Member

DHowett commented Apr 12, 2024

The GNU Octave is a cross platform project built to use the default OS terminal. Currently we would love to be able to identify if that is the new Windows Terminal. There is some incompatibility between conhost and the new Windows Terminal that is causing strange artifacts and program crashes for users of the new Windows Terminal that became very apparent when win11 made it the default. Octave is primarily developed on linux and crossbuilt for windows users, and we have few windows developers working that part of the program.

For now we wanted to create a script to try to identify if Octave was started in the Windows Terminal to prompt the user to switch, but so far have just settled on checking if the the registry key was set for having Windows Console Host be system default, and prompt the Windows users to switch the system default to that if it's not. Yes, it is a rather poor workaround. but it's effective. Until we have the developer resources to better troubleshoot the conhost / windows terminal incompatibility (or finish developing a separate, cross-platform compatible terminal widget to bundle with Octave), that change solves the problem for the users. But it does come with some false positives for the prompt because it gets set off when the windows setting is "let windows decide" even if that wouldn't use the new terminal, causing some other user confusion. So, it would at least be cleaner if at startup we could positively identify the Windows terminal.

Originally posted by @NRJank in #7434 (comment)

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Apr 12, 2024
@DHowett
Copy link
Member Author

DHowett commented Apr 12, 2024

This as well - thanks for the comment! I hate for us to be incompatible with anything unless we've decreed it so (and mostly that's just "we decree it so when we think 35-year-old Windows-specific apps have had it too good")

@NRJank
Copy link

NRJank commented Apr 12, 2024

hah, understood, and thanks again. had looked at creating an issue when we had a better idea of what to report was the issue, but useful troubleshooting has been limited to date. If i can find some useful snippets of that I'll link and/or summarize. I think at the moment that it's related to different terminal buffer behavior, which I have read is a known issue between old and new terminals.

@vefatica
Copy link

I have been using Octave as a WT profile for a few weeks and I have had no problems. Are particular incompatibilities noted anywhere?

@lhecker
Copy link
Member

lhecker commented Apr 17, 2024

Out of the links above, this one seems to have the most information: https://octave.discourse.group/t/octave-crashing-with-weird-characters-and-not-loading/4951

@vefatica
Copy link

vefatica commented Apr 17, 2024

Thanks! What's shown there is bizarre. As I said I have had no problems. I have seen no evidence that Octave uses VT control sequences (but coming from UNIX, it might).

@carlos-zamora carlos-zamora added Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Apr 17, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Tag-Fix Doesn't match tag requirements label Apr 17, 2024
@carlos-zamora carlos-zamora added the Priority-2 A description (P2) label Apr 17, 2024
@carlos-zamora carlos-zamora added this to the Backlog milestone Apr 17, 2024
@NRJank
Copy link

NRJank commented May 31, 2024

apologies for letting this sit, seems i didn't catch the later comment notifications.

a small amount of debugging was done and described in this Octave developer comment/thread

Summary description:

The garbled output in the command window probably happens because escape sequence processing gets turned on even when we don’t want it and the scrolling problem happens because the new console doesn’t respect the buffer size that we want to set.

Whether it was reasonable for us to expect the previous behavior or we were just “lucky” that it worked for us, I don’t know (see comment #45 for some more about that).

@NRJank
Copy link

NRJank commented Oct 22, 2024

coming back to this again, didn't notice the mention in the other thread. I see this comment over there:

Yea... that thread doesn't really have anything valuable in it. https://octave.discourse.group/t/cli-is-open-together-with-gui-in-octave-7-1-on-windows-11/2753/14 has some additional info, but it sounds kinda like they just don't have the support to deal with this case.

Reading between the lines, I'm guessing they were using ShowWindow(GetConsoleWindow(), SW_HIDE) to hide a console they were spawning, instead of just requesting a hidden one to begin with.

I'd much rather help them sort that out on their side, than offer a bodgy opt-out on our side ☺️
-- zadjii-msft

Didn't want to lose that nugget above as we've periodically come back to this. the first suggestion of insufficient win gui devs to deal with WT changes to things that worked under conhost is correct. whether they were 'supposed to work' is another issue. as we're still considering bundling another terminal widget to sidestep the problem, i'd personally prefer the 'sorting it out on our side' approach

@lhecker lhecker added the Needs-Attention The core contributors need to come back around and look at this ASAP. label Oct 22, 2024
@NRJank
Copy link

NRJank commented Oct 22, 2024

this did trigger a bit more digging,

  1. two issues - we do use ShowWindow(GetConsoleWindow(), SW_HIDE), and it does prevent the old windows console from appearing (removing it makes it reappear), but removing that and attempting other ways of suppressing the duplicate Windows Terminal were unsuccessful. Would be curious what 'just requesting a hidden one to begin with' is. several rounds of playing around with something like https://stackoverflow.com/a/780512, made no difference in the visibility of that terminal.

  2. there is still the second, and more pressing issue for us which is that whether or not the window is suppressed, we lose ability to scroll back through the screen buffer, and attempting to do so causing either 'odd' behavior or garbled screen data, for example: https://octave.discourse.group/t/octave-crashing-with-weird-characters-and-not-loading/4951
    there appears to be some change to how we were accessing the screen buffer with conhost, and what works now, and that's not clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

5 participants