aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-11-16 19:01:58 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-11-22 18:29:43 +0000
commit1e1fb157dc5762f571d8e39e837c010ef9aaf45b (patch)
tree8e32be65a20cd9026c3cf327fb8615fab85af29b /scripts
parentremove pre-generated input corpus for PGO (diff)
scripts: generate-alt-random-writes: mix \e[S with \n
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/generate-alt-random-writes.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/generate-alt-random-writes.py b/scripts/generate-alt-random-writes.py
index 0120fe7b..5e7ab540 100755
--- a/scripts/generate-alt-random-writes.py
+++ b/scripts/generate-alt-random-writes.py
@@ -69,7 +69,11 @@ def main():
lines_to_scroll = rand.read(1)[0] % (lines - 1)
rev = rand.read(1)[0] % 2
- out.write(f'\033[{lines_to_scroll + 1}{"T" if rev == 1 else "S"}')
+ if not rev and rand.read(1)[0] % 2:
+ out.write(f'\033[{lines};{cols}H')
+ out.write('\n' * lines_to_scroll)
+ else:
+ out.write(f'\033[{lines_to_scroll + 1}{"T" if rev == 1 else "S"}')
continue
# Generate a random location and a random character