Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Takes account of the width of the current terminal for displaying the normal list #551

Merged
merged 3 commits into from Feb 29, 2012

Conversation

@hgdeoro
Copy link

@hgdeoro hgdeoro commented Feb 5, 2012

This works only on *nix, since I don't know any portable way to get the current width of the console. This doesn't depends on any external library, and use the "stty" program, available in most of the *nix.

In case of error, silently fails and use the default value of 75.

Running -f tests/test_parallel.py --list changes from:

    Available commands:

    FabricTest    Nose-oriented test runner which wipes state.env and provid...
    TestParallel
    eq_           Shadow of the Nose builtin which presents easier to read m...
    server        Returns a decorator that runs an SSH server during functio...

to:

Available commands:

    FabricTest    Nose-oriented test runner which wipes state.env and provides file helpers.
    TestParallel
    eq_           Shadow of the Nose builtin which presents easier to read multiline output.
    server        Returns a decorator that runs an SSH server during function execution.
@hgdeoro
Copy link
Author

@hgdeoro hgdeoro commented Feb 5, 2012

After furder testing in many terminal sizes, I've found that I forgot to include the space used for the '...'. I'm fixin this now....

@hgdeoro
Copy link
Author

@hgdeoro hgdeoro commented Feb 5, 2012

Now it is working ok.

@bitprophet
Copy link
Member

@bitprophet bitprophet commented Feb 6, 2012

You should look around the source code more -- there is already a method for determining the local terminal size, which is used for e.g. setting the remote terminal size when needed. It's _pty_size in utils.py. Using this should make your patch a bit smaller/cleaner :)

@hgdeoro
Copy link
Author

@hgdeoro hgdeoro commented Feb 6, 2012

Ok, changed it to use _pty_size().

bitprophet added a commit that referenced this pull request Feb 29, 2012
Takes account of the width of the current terminal for displaying the normal list
@bitprophet bitprophet merged commit 4c309b0 into fabric:master Feb 29, 2012
bitprophet added a commit that referenced this pull request Feb 29, 2012
bitprophet added a commit that referenced this pull request Feb 29, 2012
bitprophet added a commit that referenced this pull request Feb 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.