question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Input/Output blocks post-action until keypress

See original GitHub issue

I’ve been trying to leverage the Run Script PostAction with a custom script that lives in my template that gets turned into an executable script by a first PostAction.

However I’m running into a bit of an issue when trying to run interactive commands such as editor windows.

Essentially:

git commit -m "Initial Commit" -e

in the PostAction script will indefinitely block the dotnet new command until another key is pressed without the editor window being shown. Once a key is pressed the editor window shows up and works as expected. These pauses are a bit weird and might have to do with the handover to another application somehow, at the very least they make people wait a long time while the action has already taken place. I was about to file a bug report that it blocks indefinitely in general until I pressed a key and suddenly there was an editor window.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Blackclawscommented, Jul 19, 2021

The issue is indeed a bit different. The program I called from my script wrote some of its output to stderr, requesting the user to press enter to continue. This was not printed in the ongoing log. So the issue is actually that stderr is not being printed (or it is sometimes printed if the command does NOT succeed at the end). Otherwise its simply silently dropped.

A solution would be to not redirect stderr during the run or at least copy it to console as well when redirectStandardOutput is set to false.

Minimal example:

https://github.com/Blackclaws/dotnet-template-issue

0reactions
vlada-shubinacommented, Jul 20, 2021

@Blackclaws I’ve added additional configuration redirectStandardError in https://github.com/dotnet/templating/pull/3499 which allows to configure whether stream should be redirected or not, it will be available in next .NET 6 preview (RC 1)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Keep program open until key pressed - with threads and ...
tl;dr: I have several threads, one being a thread listening to input() to keep the program running/exit on keypress. But at one time...
Read more >
while loop until keypress : r/bash
I am wanting to loop a script until a keypress, at which point I want the script to exit, or run a different...
Read more >
Keyboard: keydown and keyup
If a key is being pressed for a long enough time, it starts to “auto-repeat”: the keydown triggers again and again, and then...
Read more >
Waiting for a key press in the Update method
Hi, I'm working on a game in which I want the game to wait in the update function inside an if statement until...
Read more >
keypress event | jQuery API Documentation
The keypress event is sent to an element when the browser registers keyboard input.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found