gnachman/iTerm2 — pull request #156 by saitoha (2014-01-01 06:59:04+00:00)
Title: Fix off-by-one issue of CPR on the right edge of terminal

resize(1) command (distributed with xterm) sometimes move cursor to (999, 999) and get CPR response for retrieve current dimensions of terminal text area.
On xterm, this command behaves as follows:

```
% resize -s 24 80
COLUMNS=80;
LINES=24;
export COLUMNS LINES;

% resize
COLUMNS=80;
LINES=24;
export COLUMNS LINES;
```

But on current iTerm2, this shows:

```
% resize -s 24 80
COLUMNS=80;
LINES=24;
export COLUMNS LINES;

% resize
COLUMNS=81;
LINES=24;
export COLUMNS LINES;
```

For one more example:

```
% printf "\033[8;24;80t\033[999;999H\033[6n";cat
```

The report for above sequence in iTerm2 is

```
^[[24;81R
```

but it should be:

```
^[[24;80R
```

This patch will fix above problem.