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
First submission of the title update patch
Simpler patch that takes periodic updates configuration into account
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.