Menu

#44 Update the window/tab title on a timer

pending-postponed
nobody
None
3
2011-08-28
2011-08-27
No

This patch adds the ability for the console window's title to be reflected in the window and/or tab title, which is handy when running programs that update the console window's title, such as the simple C# program below:

using System;
using System.Threading;

namespace ProgressCounter
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i < 101; i++)
{
Console.Title = String.Format("Working... {0,3}%", i);
Thread.Sleep(100);
}
}
}
}

I tested with and without tabs showing, as well as with a custom title for the window. The window and tab titles were updated as expected!

The only thing I'm not sure about is the implementation of this feature. I added a TODO regarding the configuration of the update timeout and I tried to mimic existing code as best I could.

Let me know if you would like me to change anything or if you need me to submit in some other fashion.

Cheers,
- Oli

Discussion

  • Olivier Dagenais

    First submission of the title update patch

     
  • Kirill

    Kirill - 2011-08-28

    Simpler patch that takes periodic updates configuration into account

     
  • Kirill

    Kirill - 2011-08-28
    • priority: 5 --> 3
    • status: open --> pending-postponed
     
  • Kirill

    Kirill - 2011-08-28

    Marko is currently working on much nicer solution that does not involve timers.

    Also, you can try a simpler change that takes periodic updates configuration into account. In oppose to percieved performance penalty, it actually adds very little overhead.

     

Log in to post a comment.