Closed flt6 closed 1 year ago
I've explained in other issues that windows do not support ANSI Escape Codes, which are necessary to read the number of columns available and to control the cursor.
But I think windows users can do something to counter those, like installing colorama
and/or using another terminal, but I'm not sure as I've never used windows for python programming.
Please search for closed issues regarding windows here.
I have checked that ANSI Escape Codes is available in console cmder.
I have checked with the following ways:
print("\033[1;31mColorful text.\033[0m")
colorama.init
before using alive_progressfrom alive_progress import alive_bar
from colorama import init
from time import sleep
init()
with alive_bar(10) as bar:
bar.text = "111111111111111111111111111111111111111111111111111111111111111111"
for i in range(5):
sleep(2)
bar()
Please provide your code or else we cant help you.
Please provide your code or else we cant help you.
I have referenced at last commit.
from alive_progress import alive_bar
from colorama import init
from time import sleep
init()
with alive_bar(10) as bar:
bar.text = "111111111111111111111111111111111111111111111111111111111111111111"
for i in range(5):
sleep(2)
bar()
That's excellent! Thanks for the additional info. I'm glad it does support ANSI Escape Codes. Which terminal is this? I suppose it is not the default one.
It seems it is not retrieving the terminal size, that's why alive-progress
does not know where to clip the row.
A few months ago, to support some unusual environments, I started using the shutil
version, which does not fail ever and just returns 80 columns in these cases...
Please test this:
In [2]: import os
In [3]: os.get_terminal_size()
Out[3]: os.terminal_size(columns=120, lines=40)
They said cmder, so from a quick google looks like https://cmder.app/
I have run your test code.
>>> os.get_terminal_size()
os.terminal_size(columns=149, lines=41)
>>> os.terminal_size(columns=120, lines=40)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: structseq() missing required argument 'sequence' (pos 1)
>>> os.terminal_size((120,40)) # maybe it should be like this
os.terminal_size(columns=120, lines=40)
In windows, it runs like this.