yas icon indicating copy to clipboard operation
yas copied to clipboard

Use stdin/stdout on Windows when possible instead of creating a new Console window

Open poscat0x04 opened this issue 2 years ago • 3 comments

Currently, yas opens a new cmd.exe-like console window/buffer even if being executed inside a terminal like Window Terminal. This causes a few issues:

  1. Executing yas.exe --help only prints the help message onto the newly created window, which then immediately closes after yas.exe exits, leaving the user with no help messages whatsoever.
  2. Essentially the same issue as 1. when your supply yas with incorrect CLI arguments: no message is delivered.
  3. The console window does not support copying.

Proposed solution:

Print to stdout by default. Only open a console when you're sure that the program is not already in a terminal.

poscat0x04 avatar Jan 06 '23 15:01 poscat0x04

没复现 image image

Fachep avatar Jan 07 '23 09:01 Fachep

Running yas inside a shell that's being run at administrator's privilege does solve this issue. Though I think yas should work inside an unprivileged shell as well.

poscat0x04 avatar Jan 07 '23 11:01 poscat0x04

This and https://github.com/wormtql/yas/issues/100 are possibly two sides of the same coin.

poscat0x04 avatar Jan 07 '23 11:01 poscat0x04