Terminal.get_location() coordinates do not match Terminal.move() coordinates
See original GitHub issueI’m using blessed 1.14.1
. The x and y-values returned by Terminal.get_location()
are one greater than the values needed for Terminal.move()
to put the cursor at that location.
Example:
import blessed
def move_and_report(row=0, col=0):
term = blessed.Terminal()
print(term.move(row, col), end='', flush=True)
y, x = term.get_location()
print('o <-- y, x: {}, {}'.format(y, x), end='', flush=True)
get_location
docstring indicates this is not the intended behavior:
"""The ``(row, col)`` return value matches the parameter order of the
``move`` capability, so that the following sequence should cause the
cursor to not move at all::
>>> term = Terminal()
>>> term.move(*term.get_location()))"""
Somewhat related to issue #65
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Terminal.get_location() coordinates do not match ... - GitHub
I'm using blessed 1.14.1 . The x and y-values returned by Terminal.get_location() are one greater than the values needed for Terminal.move() ...
Read more >Get User's Current Location / Coordinates - Stack Overflow
To get a user's current location you need to declare: let locationManager = CLLocationManager(). In viewDidLoad() you have to instantiate the ...
Read more >adb - A way to get location coordinates from command line
Looks like there is a way: adb shell dumpsys location > dumpsys.txt. This will give you a file with all location service information....
Read more >React Native geolocation: A complete tutorial - LogRocket Blog
Explore geolocation in React Native using the react-native-geolocation-service library and build an app that fetches user coordinates.
Read more >Find Terminal Coordinates, Given a Bearing and a Distance
The shortest distance between two points on the surface of a sphere is an arc, not a straight line. (Try this using a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems like the
%i
inu6
is being ignored. According to this, if%i
is present inu6
, the values should be decremented. I’m not seeing anywhere in the code that’s happening.thanks again @avylove, I’ve added to changelog