Skip to content

Instantly share code, notes, and snippets.

@ttdoda
Created June 6, 2013 10:53
Show Gist options
  • Save ttdoda/5720732 to your computer and use it in GitHub Desktop.
Save ttdoda/5720732 to your computer and use it in GitHub Desktop.
xtermで左マージン上にカーソルがある時にCRが正しく働かない現象の修正。
--- cursor.c.orig 2012-06-04 04:57:47.000000000 +0900
+++ cursor.c 2013-06-06 19:35:14.000000000 +0900
@@ -265,19 +265,19 @@
void
CarriageReturn(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
int left = ScrnLeftMargin(xw);
int col;
if (xw->flags & ORIGIN) {
col = left;
- } else if (screen->cur_col > left) {
+ } else if (screen->cur_col >= left) {
col = left;
} else {
/*
* If origin-mode is not active, it is possible to use cursor
* addressing outside the margins. In that case we will go to the
* first column rather than following the margin.
*/
col = 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment