API Change: Terminal.move (y, x) => (x, y).
See original GitHub issueThis issue duplicates upstream issue, https://github.com/erikrose/blessings/issues/58
Problem
Terminal.location is (x, y) but Terminal.move is (y, x).
This causes issues with composability of positional (y, x) parameters. Also causes programmer mistakes.
Solution
Terminal.move to positional ordering, (y, x)
=> (x, y)
.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
API Change: Terminal.move (y, x) => (x, y). #65 - GitHub
Terminal.location is (x, y) but Terminal.move is (y, x). This causes issues with composability of positional (y, x) parameters. Also causes ...
Read more >c++ - Move text cursor to particular screen coordinate?
I remember a function called gotoxy(x,y) , but I think its deprecated. Is there any alternative? c++ · c · windows · console...
Read more >Terminal control/Cursor positioning - Rosetta Code
Move the cursor to column 3, row 6, and display the word "Hello" (without the quotes), so that the letter H is in...
Read more >terminal.py — Blessed 1.19.1 documentation
A callable string that moves the cursor to the given (y, x) screen coordinates. Parameters. y (int) – vertical position, from top, 0,...
Read more >Posix command that moves cursor to specific position in ...
Even with escape sequences, there are several ways to move the cursor on various terminals. Here are a few terminfo summaries of those:...
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
If you’re planning to do this major API breaking changes, why not change Terminal.move to (x, y) instead? Isnt the (x, y) order more of a standard then (y, x)?
In source codes I’ve seen with Curses, people almost always define X first and Y second, but then reverse the order when passing them as parameters because of Curses. What I mean is that people “think” (x, y) and not (y, x). The first time I noticed that in Curses, I immediately went looking for an alternative. It might confuse the user about order of width and height too.
Here’s a quote from Python 3 documentation of Curses: “This breaks the normal convention for handling coordinates where the x coordinate comes first. This is an unfortunate difference from most other computer applications, but it’s been part of curses since it was first written, and it’s too late to change things now.”
Pleaseee, dont follow the same road like they did!
Added
term.move_yx
andterm.move_xy
for next release, and we recommend onlyterm.move_xy
in the documentation and examples going forward.move
still exists for compatibility, sorry, just wasn’t enough to break major api!