dclamage/SudokuSolver

Cannot run listen-mode without console

Opened this issue · 0 comments

I am trying to set up the solver service to run as a systemd unit, eventually I'd love to have it socket-activated, but for now just having it run as a unit will do.

Unfortunately because systemd services run without a connected pseudotty, I get:

Unhandled exception. System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read.
   at System.ConsolePal.ReadKey(Boolean intercept)
   at SudokuSolverConsole.Program.Main(String[] args)
   at SudokuSolverConsole.Program.<Main>(String[] args)

Presumably this would be because the listen-mode is expecting to run in a terminal.

It would be useful if there was a way to tell --listen to not worry about keypresses so that it'd run in this scenario. Is there a way, or would it need code changes?