dclamage / SudokuSolver

GNU General Public License v3.0
50 stars 24 forks source link

Cannot run listen-mode without console #102

Open kinnison opened 2 years ago

kinnison commented 2 years ago

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?