Skip to content
Snippets Groups Projects
Commit 392633d7 authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

scmutil: clarify that we explicitly do termwidth - 1 on Windows

I was a bit confused since we didn't add 1 to the width, which is different
from the example shown in StackOverflow.

http://stackoverflow.com/a/12642749
parent 1ad1c501
No related branches found
No related tags found
No related merge requests found
......@@ -352,7 +352,7 @@
# counted in the line length. On 80 columns consoles, if 80
# characters are written, the following CR won't apply on the
# current line but on the new one. Keep room for it.
width = 79
width = 80 - 1
# Query stderr to avoid problems with redirections
screenbuf = _kernel32.GetStdHandle(
_STD_ERROR_HANDLE) # don't close the handle returned
......@@ -362,7 +362,7 @@
if not _kernel32.GetConsoleScreenBufferInfo(
screenbuf, ctypes.byref(csbi)):
return width
width = csbi.srWindow.Right - csbi.srWindow.Left
width = csbi.srWindow.Right - csbi.srWindow.Left # don't '+ 1'
return width
def _1stchild(pid):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment