Skip to content

Instantly share code, notes, and snippets.

@saitoha
saitoha / screen-ttymouse.diff
Created May 20, 2013 15:05
vim ttymouse auto detection for GNU Screen/tmux
diff -r e56bf2af53c0 src/os_unix.c
--- a/src/os_unix.c Wed May 15 23:13:10 2013 +0200
+++ b/src/os_unix.c Tue May 21 00:04:11 2013 +0900
@@ -2190,6 +2190,7 @@
|| STRNICMP(name, "kterm", 5) == 0
|| STRNICMP(name, "mlterm", 6) == 0
|| STRNICMP(name, "rxvt", 4) == 0
+ || STRNICMP(name, "screen", 6) == 0
|| STRCMP(name, "builtin_xterm") == 0);
}
@saitoha
saitoha / fix-cpr-offbyone.diff
Last active December 17, 2015 13:49
jfbterm - fix CPR off-by-one issue
Index: vterm.c
===================================================================
RCS file: /cvsroot/jfbterm/jfbterm/vterm.c,v
retrieving revision 1.20
diff -u -r1.20 vterm.c
--- vterm.c 10 May 2004 18:08:47 -0000 1.20
+++ vterm.c 21 May 2013 14:50:03 -0000
@@ -1114,7 +1114,7 @@
if (arg == 6) {
int x = (p->pen.x < p->xmax-1) ? p->pen.x : p->xmax-1;
@saitoha
saitoha / poderosa-focus-reporting.diff
Created May 22, 2013 17:33
Poderosa - Add focus reporting mode (DECSET/DECRST 1004) for Poderosa
diff --git a/TerminalEmulator/TerminalBase.cs b/TerminalEmulator/TerminalBase.cs
index 5d4eb09..810da88 100644
--- a/TerminalEmulator/TerminalBase.cs
+++ b/TerminalEmulator/TerminalBase.cs
@@ -343,6 +343,10 @@ public abstract class AbstractTerminal : ICharProcessor, IByteAsyncInputStream {
return false;
}
+ public virtual bool GetFocusReportingMode() {
+ return false;
@saitoha
saitoha / iterm2-quickfix-rendering.diff
Created June 3, 2013 15:43
Quickfix patch for Term2 1.0.0.20130602 beta rendering bug.
diff --git a/PTYTextView.m b/PTYTextView.m
index a08115e..1cf1251 100644
--- a/PTYTextView.m
+++ b/PTYTextView.m
@@ -6150,6 +6150,7 @@ static double EuclideanDistance(NSPoint p1, NSPoint p2) {
CGFloat curX = initialPoint.x;
CharacterRun *thisChar = [[[CharacterRun alloc] init] autorelease];
thisChar.advancedFontRendering = advancedFontRendering;
+ BOOL doubleWidthCache = NO;
for (int i = indexRange.location; i < indexRange.location + indexRange.length; i++) {
@saitoha
saitoha / xterm-cr-respect-leftmargin.diff
Created June 6, 2013 16:02
Make CR behavior respect left margin when vertical split mode is enabled.
diff -rNU5 a/cursor.c b/cursor.c
--- a/cursor.c 2012-06-04 04:57:47.000000000 +0900
+++ b/cursor.c 2013-06-07 00:23:08.000000000 +0900
@@ -269,12 +269,14 @@
int left = ScrnLeftMargin(xw);
int col;
if (xw->flags & ORIGIN) {
col = left;
- } else if (screen->cur_col > left) {
@saitoha
saitoha / iterm2-left-right-margin.diff
Last active December 18, 2015 08:00
Add DECLRMM(DECVSSM) and DECSLRM feature to iTerm2 (on progress)
diff --git a/VT100Screen.h b/VT100Screen.h
index d47185e..585d326 100644
--- a/VT100Screen.h
+++ b/VT100Screen.h
@@ -87,6 +87,8 @@ void TranslateCharacterSet(screen_char_t *s, int len);
int ALT_SAVE_CURSOR_Y;
int SCROLL_TOP;
int SCROLL_BOTTOM;
+ int SCROLL_LEFT;
+ int SCROLL_RIGHT;
@saitoha
saitoha / left-right-margin.vim
Created June 12, 2013 16:10
Accelerate vim vsplit scrolling on pangoterm/xterm/tanasinn/RLogin.
let &t_ti = &t_ti . "\e[?6h\e[?69h"
let &t_te = "\e[?69l\e[?6l" . &t_te
let &t_CV = "\e[%i%p1%d;%p2%ds"
let &t_CS = "y"
@saitoha
saitoha / quick-fix-for-iTerm2-canonical-parser.diff
Created June 17, 2013 15:16
Quick fix for iTerm2 continuous parsing bug on canonical parser.
diff --git a/VT100Terminal.m b/VT100Terminal.m
index dd67b60..c33dde9 100644
--- a/VT100Terminal.m
+++ b/VT100Terminal.m
@@ -751,7 +751,6 @@ static int getCSIParamCanonically(unsigned char *datap,
return datap - orgp;
cancel:
- param->cmd = 0xff;
return datap - orgp;
@saitoha
saitoha / iterm2-decarm.diff
Last active December 18, 2015 21:09
DECARM(auto repeat mode) for iTerm2
diff --git a/PTYTextView.m b/PTYTextView.m
index 433f279..16050ac 100644
--- a/PTYTextView.m
+++ b/PTYTextView.m
@@ -2355,6 +2355,11 @@ NSMutableArray* screens=0;
NSLog(@"keycode is slash=%d, is backslash=%d", (keyCode == 0x2c), (keyCode == 0x2a));
}
+ // discard repeated key event if auto repeat mode (DECARM) is disabled
+ if (keyIsARepeat && ![[dataSource terminal] autorepeatMode]) {
@saitoha
saitoha / fix-decaln-behavior.diff
Created June 30, 2013 09:33
Fix DECALN behavior
diff --git a/VT100Screen.m b/VT100Screen.m
index a0d4db5..1e03101 100644
--- a/VT100Screen.m
+++ b/VT100Screen.m
@@ -1997,6 +1997,12 @@ static BOOL XYIsBeforeXY(int px1, int py1, int px2, int py2) {
}
aLine[WIDTH].code = EOL_HARD;
}
+ // reset scroll region
+ SCROLL_TOP = 0;