Skip to content
Browse files

initialize tabs tops in tmux mode from the last one out to 1000 on di…

…visible-by-8 boundaries. This isn't really the right thing to do, but tmux's handling of tab stops is very complex because they change them in so many different places.
  • Loading branch information...
1 parent 128b71b commit ee0faefd63806d4c49e69918080c0cea14940290 @gnachman committed May 11, 2012
Showing with 8 additions and 2 deletions.
  1. +7 −0 VT100Screen.m
  2. +1 −2 VT100Terminal.m
View
7 VT100Screen.m
@@ -3603,8 +3603,15 @@ - (void)setTmuxState:(NSDictionary *)state
[self showCursor:[[state objectForKey:kStateDictCursorMode] boolValue]];
[tabStops removeAllObjects];
+ int maxTab = 0;
for (NSNumber *n in [state objectForKey:kStateDictTabstops]) {
[tabStops addObject:n];
+ maxTab = MAX(maxTab, [n intValue]);
+ }
+ for (int i = 0; i < 1000; i += 8) {
+ if (i > maxTab) {
+ [tabStops addObject:[NSNumber numberWithInt:i]];
+ }
}
// TODO: The way that tmux and iterm2 handle saving the cursor position is different and incompatible and only one of us is right.
View
3 VT100Terminal.m
@@ -428,8 +428,7 @@ static VT100TCC decode_csi(unsigned char *datap,
result.type = VT100_WAIT;
// Check for unkown
- if(param.cmd == 0xff)
- {
+ if (param.cmd == 0xff) {
result.type = VT100_UNKNOWNCHAR;
*rmlen = paramlen;
}

0 comments on commit ee0faef

Please sign in to comment.
Something went wrong with that request. Please try again.