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

Flickering console window when sending Ctrl+C #60

Closed
segrey opened this issue Nov 21, 2018 · 10 comments
Closed

Flickering console window when sending Ctrl+C #60

segrey opened this issue Nov 21, 2018 · 10 comments

Comments

@segrey
Copy link
Contributor

segrey commented Nov 21, 2018

When a process is started without console window, executing org.jvnet.winp.WinProcess#sendCtrlC leads to running sendctrlc.exe with a new console visible window. Even though sendctrlc.exe is a short-living process, the console window flickering is noticeable.

To reproduce the issue, please see myapp.zip.
It's a simple Java Swing application running new WinProcess(123).sendCtrlC() on button click.

  1. Unzip the project and optionally rebuild it.
  2. Run the app with run.cmd. Or start it manually, just ensure you're using javaw.exe instead of java.exe to start the process without console window.
  3. A window with a single button will appear:
    image
  4. Click it and a console window will appear and hide.
@segrey
Copy link
Contributor Author

segrey commented Nov 21, 2018

I have a patch for this issue based on using java.lang.ProcessBuilder and spawn sendctrlc.exe from Java instead of doing it in winp.cpp (SendCtrlC). If no objections, I'll open the PR soon.

@segrey
Copy link
Contributor Author

segrey commented Nov 21, 2018

The issue affects IDE users: https://youtrack.jetbrains.com/issue/IDEA-202408

@oleg-nenashev
Copy link
Member

oleg-nenashev commented Nov 22, 2018 via email

segrey added a commit to segrey/winp that referenced this issue Nov 22, 2018
…nkinsci#60, jenkinsci#55)

Additionally, diagnostics is improved by capturing output stream.
@segrey
Copy link
Contributor Author

segrey commented Nov 27, 2018

Suggested fix: PR #61

oleg-nenashev added a commit that referenced this issue Dec 8, 2018
run sendctrlc.exe with Java (no console window, simpler code) (#60, #55)
@segrey
Copy link
Contributor Author

segrey commented Jan 25, 2019

Fixed by be5a29f

@segrey segrey closed this as completed Jan 25, 2019
@segrey
Copy link
Contributor Author

segrey commented Feb 15, 2019

Another reported case about flickering window popup: https://youtrack.jetbrains.com/issue/WEB-36921 (IntelliJ IDEA).
@oleg-nenashev Would be great to cut a release.

@oleg-nenashev
Copy link
Member

@segrey I am still waiting for the new Windows laptop, sorry :(
Let's proceed with #64 which might be a quicker solution. I might get my laptop next week, but it's hard to guarantee

@segrey
Copy link
Contributor Author

segrey commented Feb 15, 2019

Sure, next week is fine. Regarding #64, sorry, can it help to cut a release quicker?

@oleg-nenashev
Copy link
Member

oleg-nenashev commented Feb 15, 2019 via email

SergeyZh pushed a commit to JetBrains/intellij-community that referenced this issue Feb 25, 2019
Changes:
* No flickering console window when sending Ctrl+C (jenkinsci/winp#60)
* Support sending Ctrl+C on Windows 8.1 (jenkinsci/winp#58)
SergeyZh pushed a commit to JetBrains/intellij-community that referenced this issue Feb 25, 2019
Changes:
* No flickering console window when sending Ctrl+C (jenkinsci/winp#60)
* Support sending Ctrl+C on Windows 8.1 (jenkinsci/winp#58)

(cherry picked from commit 4066dac)
@oleg-nenashev
Copy link
Member

Fixed in WinP 1.28

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

No branches or pull requests

2 participants