title: Keep console window open
body: <p>This is how I keep the console window open now:</p>
  
  <pre><code>private static void Main(string[] args)
  {
      // Timers run here
  
      while(true)
      {
          Console.Read();
      }
  }
  </code></pre>
  
  <p>But it always gets back to me: there must be a better way. The reason that <code>Console.Read()</code> is in an eternal <code>while</code> is because I don't want my program to terminate if by mistake I press <code>enter</code> while it's running and I'm focused on its window.</p>
  
  <p>Any ideas?</p>
  
  <p>Relevant questions that don't answer my question:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/16952846/c-sharp-how-to-keep-console-window-open">How to keep console window open</a></li>
  <li><a href="https://stackoverflow.com/questions/3806511/alternative-to-console-readline-to-keep-the-console-visible">Alternative to Console.ReadLine() to keep the Console visible</a></li>
  <li><a href="https://stackoverflow.com/questions/203246/how-can-i-keep-a-console-open-until-cancelkeypress-event-is-fired">How can I keep a console open until CancelKeyPress event is fired?</a></li>
  </ul>