Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
saitoha committed May 25, 2015
2 parents 68ea809 + 794584c commit 1bb6fe6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
12 changes: 4 additions & 8 deletions MTParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

if (strncmp(spec, "rgb:", 4) == 0) {
p = spec + 4;
while (p) {
while (*p) {
component = strtoul(p, &endptr, 16);
if (component == ULONG_MAX)
break;
Expand All @@ -34,7 +34,7 @@
break;
++p;
}
if (*p == '\0' || *p == '/')
if (*p != '\0')
return (-1);
if (index != 3)
return (-1);
Expand Down Expand Up @@ -681,13 +681,11 @@ static void pop_title(MTShell *shell, int param)
static void esc_dispatch(struct parse_context *ppc, char *p, MTShell *shell)
{
switch (ppc->action) {
#if 0
case 'Z':
[(TTShell*) shell writeData: [NSData dataWithBytes: PDA_RESPONSE
length: PDA_RESPONSE_LEN]];
*p = 0x7f;
break;
#endif
case 'c':
handle_ris(ppc, shell);
break;
Expand All @@ -710,7 +708,7 @@ static void get_current_position(MTShell *shell, int *x, int *y)
if (*y >= frame.size.height) *y = frame.size.height - 1;
if ([shell MouseTerm_getCoordinateType] == CELL_COORDINATE) {
CGSize size = [view cellSize];
*x = (int)round(*x / (double)size.width + 1.0);
*x = (int)round(*x / (double)size.width);
*y = (int)round(*y / (double)size.height + 0.5);
}
}
Expand All @@ -720,13 +718,11 @@ static void csi_dispatch(struct parse_context *ppc, char *p, MTShell *shell)
int i;

switch (ppc->action) {
#if 0
case 'c':
[(TTShell*) shell writeData: [NSData dataWithBytes: PDA_RESPONSE
length: PDA_RESPONSE_LEN]];
*p = 0x7f;
break;
#endif
case ('>' << 8) | 'c':
[(TTShell*) shell writeData: [NSData dataWithBytes: SDA_RESPONSE
length: SDA_RESPONSE_LEN]];
Expand Down Expand Up @@ -837,7 +833,7 @@ static void csi_dispatch(struct parse_context *ppc, char *p, MTShell *shell)
break;
case CELL_COORDINATE:
size = [view cellSize];
cellx = (int)round(pixelx / (double)size.width + 1.0);
cellx = (int)round(pixelx / (double)size.width);
celly = (int)round(pixely / (double)size.height + 0.5);
response = [NSString stringWithFormat: @"\033[1;%d;%d;%d;%d&w", button, celly, cellx, 0];
break;
Expand Down
2 changes: 1 addition & 1 deletion Mouse.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ typedef enum

// Control codes

#define PDA_RESPONSE "\033[1;2;22c"
#define PDA_RESPONSE "\033[?1;22;29c"
#define PDA_RESPONSE_LEN (sizeof(PDA_RESPONSE) - 1)

// MT(0x4d54 => 19796) ver 1.0.0(10000)
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Additionally, this project does:
Some terminal emulators such as iTerm2 also have this feature(set access only).
But they have some problems caused by buffer size restriction.
The OSC 52 implementation of MouseTerm-Plus does not have buffer size restriction, just like XTerm.
* Report original DA1 response ("\033\[?1;22;29c").
* Report original DA2 response ("\033\[>19796;10000;2c").
* Eliminate [ragel][9] dependency.
* Parse control sequences with DEC VT/ECMA-48 compliant canonical parser.
Expand Down Expand Up @@ -158,9 +159,7 @@ Download the development repository using [Git][16]:
git clone git://github.com/saitoha/mouseterm-plus.git

Run `make` to compile the plugin, and `make install` to install it
into your home directory's SIMBL plugins folder. `make test` will
install the plugin and run a second instance of Terminal.app for
testing.
into your home directory's SIMBL plugins folder.

Visit [GitHub][17] if you'd like to fork the project, watch for new
changes, or report issues.
Expand Down

0 comments on commit 1bb6fe6

Please sign in to comment.