mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-15 08:21:03 -04:00
scripts: generate-alt-random-writes: don’t always reset all attributes
This commit is contained in:
parent
1e1fb157dc
commit
60c8637231
1 changed files with 5 additions and 4 deletions
|
|
@ -123,10 +123,11 @@ def main():
|
||||||
|
|
||||||
out.write(c * repeat)
|
out.write(c * repeat)
|
||||||
|
|
||||||
if color_variant != ColorVariant.NONE:
|
do_sgr_reset = rand.read(1)[0] % 2
|
||||||
do_sgr_reset = rand.read(1)[0] % 2
|
if do_sgr_reset:
|
||||||
if do_sgr_reset:
|
reset_actions = ['\033[m', '\033[39m', '\033[49m']
|
||||||
out.write('\033[m')
|
idx = rand.read(1)[0] % len(reset_actions)
|
||||||
|
out.write(reset_actions[idx])
|
||||||
|
|
||||||
# Leave alt screen
|
# Leave alt screen
|
||||||
out.write('\033[m\033[r\033[?1049l')
|
out.write('\033[m\033[r\033[?1049l')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue