Patch for setting title of Command Prompt in windows #1

Closed
opened 2026-02-20 20:59:07 -05:00 by deekerman · 3 comments
Owner

Originally created by @rg3 on GitHub (Nov 1, 2010).

Was: http://bitbucket.org/rg3/youtube-dl/issue/214/

So I have tweaked my little patch so that it doesn't do bad things on linux/mac. Note the check for the os.

def report_progress(self, percent_str, data_len_str, speed_str, eta_str):
                """Report download progress."""
                if self.params.get('noprogress', False):
                        return
                if (os.name == 'nt'):
                        os.system('title youtube-dl [%s]' % percent_str)                        
                self.to_stdout(u'\r[download] %s of %s at %s ETA %s' %
                                (percent_str, data_len_str, speed_str, eta_str), skip_eol=True)
Originally created by @rg3 on GitHub (Nov 1, 2010). Was: http://bitbucket.org/rg3/youtube-dl/issue/214/ So I have tweaked my little patch so that it doesn't do bad things on linux/mac. Note the check for the os. <pre> def report_progress(self, percent_str, data_len_str, speed_str, eta_str): """Report download progress.""" if self.params.get('noprogress', False): return if (os.name == 'nt'): os.system('title youtube-dl [%s]' % percent_str) self.to_stdout(u'\r[download] %s of %s at %s ETA %s' % (percent_str, data_len_str, speed_str, eta_str), skip_eol=True) </pre>
deekerman 2026-02-20 20:59:07 -05:00
  • closed this issue
  • added the
    request
    label
Author
Owner

@rg3 commented on GitHub (Nov 1, 2010):

Just wanted to clarify that, even if this issue has been open for a long time, I'm not against this feature. However, I'd like it to be optional (because it does not work on Linux virtual terminals, for example), to work on every platform, and not to launch a program every time the title has to be changed.

@rg3 commented on GitHub (Nov 1, 2010): Just wanted to clarify that, even if this issue has been open for a long time, I'm not against this feature. However, I'd like it to be optional (because it does not work on Linux virtual terminals, for example), to work on every platform, and not to launch a program every time the title has to be changed.
Author
Owner

@yaplik commented on GitHub (Dec 9, 2010):

setting title on linux: http://www.faqs.org/docs/Linux-mini/Xterm-Title.html

import sys
sys.stdout.write("\x1b]0;newtitle\x07")
@yaplik commented on GitHub (Dec 9, 2010): setting title on linux: http://www.faqs.org/docs/Linux-mini/Xterm-Title.html ``` import sys sys.stdout.write("\x1b]0;newtitle\x07") ```
Author
Owner

@rg3 commented on GitHub (Jan 4, 2011):

Implemented by grawity and merged.

@rg3 commented on GitHub (Jan 4, 2011): Implemented by grawity and merged.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#1
No description provided.