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

Cannot move only x or y coordinate in Screen session #55

Open
abstiles opened this issue Dec 3, 2013 · 8 comments
Open

Cannot move only x or y coordinate in Screen session #55

abstiles opened this issue Dec 3, 2013 · 8 comments
Labels

Comments

@abstiles
Copy link

abstiles commented Dec 3, 2013

This affects move_x, move_y, and the location context manager (when only one of x or y is specified). The cause appears to be Screen's terminfo, which does not seem to define entries for "hpa" or "vpa". To test, I did the following:

$ tput -T screen cup > /dev/null; echo $? 
0
$ tput -T screen hpa > /dev/null; echo $? 
1
$ tput -T screen vpa > /dev/null; echo $? 
1

Note that changing the environment variable TERM to xterm fixes the issue.

It would be helpful if Blessings were able to internally workaround this problem transparently. As it stands, I cannot use these functions at all if I want my program to work under either Screen or Tmux (which uses Screen's terminfo).

@jquast
Copy link
Collaborator

jquast commented Mar 20, 2014

I agree. I think this is only a problem for 'screen', so far as I can tell. They can be fixed by assigning an anonymous function for this case.

            if self._kind == 'screen' and not self.hpa:
                self.hpa = lambda col: u'\x1b[{}G'.format(col + 1)
            if self._kind == 'screen' and not self.vpa:
                self.vpa = lambda col: u'\x1b[{}d'.format(col + 1)

@jquast
Copy link
Collaborator

jquast commented Apr 28, 2014

this is fixed as you recommend, "internally workaround this problem transparently", in a fork if you wish to need it, https://pypi.python.org/pypi/blessed

@abstiles
Copy link
Author

Much appreciated, I'll check it out. Any plans to contribute any of your patches back here? I don't see any pull requests for fixes like this. Have they been explicitly declined by the Blessings maintainer?

@jquast
Copy link
Collaborator

jquast commented Apr 28, 2014

I definitely tried to contribute all of my fixes and enhancements, beginning last year. The pull requests were mostly ignored/stalled -- Look in "closed" pull requests in this project and you can see them. He's more than welcome to have them all back in his own project, but I'm very sure he won't take the time to do so.

@erikrose
Copy link
Owner

I'm happy to take a patch to this effect. I certainly had a hand in stalling out those old PRs, but the sheer size of them (rather than being small, atomic changes) was also a factor. I would like to get a lot of that stuff upstreamed.

@jquast
Copy link
Collaborator

jquast commented Apr 28, 2014

I'm afraid I can't do that. For example, this change cannot be tested without @as_subprocess -- as your first test case that tests xterm-256color causes all subsequent tests to be tested as xterm-256color.

@fwenzel fwenzel added the bug label Apr 29, 2014
@jquast
Copy link
Collaborator

jquast commented Apr 8, 2015

This issue is resolved in 'blessed-integration' branch by a method of "proxying" terminal capabilities. https://github.com/erikrose/blessings/blob/blessed-integration/blessings/formatters.py#L144-148

@jquast
Copy link
Collaborator

jquast commented Feb 2, 2020

This issue is resolved in blessed, which is API compatible with blessings, by a ParameterizingProxyString class, which is provided for missing terminal capabilities, from end of blessed.formatters.resolve_attribute():

and, for special terminals, such as 'screen', provide a Proxy
ParameterizingString for attributes they do not claim to support,
but actually do! (such as 'hpa' and 'vpa').

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

No branches or pull requests

4 participants