Skip to content
This repository has been archived by the owner on Sep 27, 2018. It is now read-only.

Carriage return do not overwrite line in Windows cmd.exe and PowerShell #14

Closed
zmwangx opened this issue Apr 11, 2015 · 3 comments
Closed

Comments

@zmwangx
Copy link
Owner

zmwangx commented Apr 11, 2015

I tested the package on Windows 8.1, with:

  • Python 2.7.9 and 3.4.3;
  • FFmpeg static builds from http://ffmpeg.zeranoe.com/builds/ (specifically, FFmpeg git-df4fca2 64-bit Static);
  • Pillow installed directly through pip install Pillow (turns out there are wheel distributions for Pillow on PyPI, so there's no need to worry about external deps — so it seems to me).

metadata and storyboard both worked perfectly with the videos tested in both Python 2 and Python 3. However, the progress bar suffers from one minor problem: carriage return does not return the cursor to the beginning of the line, so the lines are not overwritten:

C:\Windows\system32>storyboard "C:\Users\Zhiming Wang\Downloads\naruto-episode-6
26__zh__06bbb67.mp4"
Processing naruto-episode-626__zh__06bbb67.mp4
Crunching metadata...
Creating thumbnail 16/16...
Drawing main storyboard...
Generating metadata sheet...
Calculating SHA-1 digest...
61.6MiB 0:00:01 [61.6MiB/s] [=========>                       ]  30% ETA 0:00:02
 147MiB 0:00:02 [83.4MiB/s] [=======================>         ]  73% ETA 0:00:00
 199MiB 0:00:02 [76.7MiB/s] [================================>] 100%

Drawing the bottom banner...
Assembling parts...
Done. Generated storyboard saved to:
C:\Users\ZHIMIN~1\AppData\Local\Temp\storyboard-zj5swd6x.jpg

I'll investigate the right way to carriage return on Windows later.

@zmwangx
Copy link
Owner Author

zmwangx commented Apr 11, 2015

Haven't tested on Cygwin just yet.

zmwangx added a commit that referenced this issue Apr 11, 2015
* Pillow installation is simpler than I thought — wheel distributions
  are provided on OS X and Windows, and I confirmed today that the wheel
  distributions on Windows do work perfectly fine. Updated instructions
  accordingly.

* storyboard was tested on Windows 8.1 today, and I only uncovered a
  minor issue about carriage returns in terminal windows (see #14 for
  details). Updated the bullet point about Windows in Known issues
  accordingly.
@zmwangx
Copy link
Owner Author

zmwangx commented Apr 11, 2015

Upon further inspection, the problem doesn't lie with \r on Windows (good to know).

Turns out cmd.exe and PowerShell on Windows are pretty dumb terminals, and once we fill the last character of the window's width, the cursor immediately move to the next line, and even carriage return won't help. Therefore, we have to leave one empty character for the cursor (which isn't even a character).

@hrchu
Copy link

hrchu commented Apr 26, 2017

nice catch!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants