[PATCH] Detect console width on Windows

Patrick Mézard pmezard at gmail.com
Mon Apr 26 08:36:41 CDT 2010


Le 26/04/10 15:20, Dan Villiom Podlaski Christiansen a écrit :
> 
> On 26 Apr 2010, at 15:16, Patrick Mézard wrote:
> 
>>> The COLUMNS fallback has the annoying effect that changing the terminal width during a long session doesn't affect Mercurial.
>>
>> I don't follow you here.
> 
> What I mean is that if I resize the window during a long Mercurial session — such as an hgsubversion pull — it has no effect. Normally, COLUMNS is set by the shell when Mercurial is invoked, and never changed during its execution. If I make my terminal window smaller, any new messages will be wrapped…

Sure, but I don't really see how it relates to the discussion: COLUMNS already overrides posix termwidth() so windows must honor it the same way. AFAIK, COLUMNS is not a default environment variable in cmd.exe, that's something you set explicitely. I see COLUMNS as a convenient option for tests or scripting, like HGPLAIN, but perhaps that's different on unix? (http://www.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap08.html seems to agree with me).

--
Patrick Mézard


More information about the Mercurial-devel mailing list