question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

API Change: Terminal.move (y, x) => (x, y).

See original GitHub issue

This 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:closed
  • Created 8 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
iderikcommented, Apr 13, 2017

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!

0reactions
jquastcommented, Jan 17, 2020

Added term.move_yx and term.move_xy for next release, and we recommend only term.move_xy in the documentation and examples going forward. move still exists for compatibility, sorry, just wasn’t enough to break major api!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found