Skip to content

Instantly share code, notes, and snippets.

View ttdoda's full-sized avatar

IWAMOTO Kouichi ttdoda

  • Kanagawa, Japan
View GitHub Profile
@ttdoda
ttdoda / xterm-decrqss-decslrm.diff
Created December 3, 2015 05:43
xtermのDECRQSSのバグ修正
--- misc.c.orig 2015-08-19 09:54:21.000000000 +0900
+++ misc.c 2015-12-02 17:41:53.123879000 +0900
@@ -4059,6 +4059,9 @@
screen->lft_marg + 1,
screen->rgt_marg + 1);
}
+ else {
+ okay = False;
+ }
} else if (!strcmp(cp, "m")) { /* SGR */
@ttdoda
ttdoda / putty-wheel-fix.diff
Created May 11, 2013 04:39
PuTTY wheel fix
Index: terminal.c
===================================================================
--- terminal.c (revision 9002)
+++ terminal.c (working copy)
@@ -5731,6 +5731,8 @@
case MA_RELEASE:
encstate = 0x23;
term->mouse_is_down = 0;
+ if (braw == MBT_WHEEL_UP || braw == MBT_WHEEL_DOWN)
+ return;
@ttdoda
ttdoda / cursor.c.diff
Created June 6, 2013 10:53
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;
@ttdoda
ttdoda / screen.c.diff
Last active December 18, 2015 04:39
vsplit時、IL/DL/NLの実行をスクロールリージョン内で行うようにする。
--- screen.c.orig 2013-06-15 17:29:09.000000000 +0900
+++ screen.c 2013-06-15 17:45:44.000000000 +0900
@@ -9020,6 +9020,7 @@
int j;
unsigned temp;
int cursor_row;
+ int cursor_col = 0;
int type;
int result_empty;
int can_ce = can_clear(T_CE);
@ttdoda
ttdoda / slrm-test1.txt
Created June 17, 2013 17:24
DECSLRMで左右マージンを設定した時のIRMやICH等の動作テスト用テキスト。端末の横幅を80桁tにしてcatで表示する。 IRM-OK等の行がVT525での出力結果。
7[?69h8IRM:01234567890#####abcdefghTESTTEST01234567890TEST7[?69l8
IRM-OK: 01234TEST567890 ##### 01234TEST56 abcTESTde
7[?69h8ICH:01234567890#####abcdefgh[4@TEST[4@TEST01234567890[4@TEST7[?69l8
ICH-OK: 01234TEST90 ##### 01234TEST56 abcTESTh
7[?69h8DCH:01234567890#####abcdefgh012345678907[?69l8
DCH-OK: 01234567890 ##### 0123490 abcdefgh
ECH:#######################################################################7[?69h87[?69l8
ECH-OK: ##### ########################################### ## ###
@ttdoda
ttdoda / slrm-test3.txt
Created July 1, 2013 17:08
左マージンの動作テスト。VT525はかなり意外な動作をする。 この挙動を再現している端末エミュレータはおそらく無い。
7[?69h812345678901234567890
#aaa
%**************************************************************
bbb
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@7[?69l8
VT525's result as follows.
12345678901234567890
# aaa
11111111111111111111111111111111111111111111111111111111111111111111111111111111
22222222222222222222222222222222222222222222222222222222222222222222222222222222
33333333333333333333333333333333333333333333333333333333333333333333333333333333
44444444444444444444444444444444444444444444444444444444444444444444444444444444
55555555555555555555555555555555555555555555555555555555555555555555555555555555
66666666666666666666666666666666666666666666666666666666666666666666666666666666
77777777777777777777777777777777777777777777777777777777777777777777777777777777
88888888888888888888888888888888888888888888888888888888888888888888888888888888
99999999999999999999999999999999999999999999999999999999999999999999999999999999
00000000000000000000000000000000000000000000000000000000000000000000000000000000
@ttdoda
ttdoda / screen-osc10_11.patch
Last active February 5, 2016 18:00 — forked from saitoha/screen-osc11.patch
GNU Screen: Support OSC 10 & 11 sequence (set foreground/background color)
diff -ur ansi.c ansi.c
--- ansi.c 2015-04-08 14:34:29.000000000 +0900
+++ ansi.c 2016-01-19 23:23:20.000000000 +0900
@@ -1554,12 +1554,12 @@
}
#endif
#ifdef RXVT_OSC
- if (typ == 0 || typ == 1 || typ == 2 || typ == 20 || typ == 39 || typ == 49)
+ if (typ == 0 || typ == 1 || typ == 2 || typ == 10 || typ == 11 || typ == 20 || typ == 39 || typ == 49)
{
@ttdoda
ttdoda / zm-delescape.diff
Created June 20, 2016 16:26
lsz -e でDEL(0x7f)および0xFFもエスケープさせるパッチ
--- src/zm.c.orig 1998-12-30 01:48:38.000000000 +0900
+++ src/zm.c 2016-06-21 01:18:04.721707000 +0900
@@ -262,7 +262,17 @@
break;
case 1:
xsendline(ZDLE);
- c ^= 0100;
+ switch (c) {
+ case 0177:
+ c = ZRUB0;
@ttdoda
ttdoda / gist:eeb3431f68b4d23c349eaa5ae90b437b
Last active January 6, 2017 04:41
PATHに : を含められるか。zshの場合
sue@mizup% echo $PATH
/bin:/usr/bin
sue@mizup% echo $path
/bin /usr/bin
sue@mizup% cat /home/sue/path:test/path-test
#!/bin/sh
echo $0 test
sue@mizup% path-test
zsh: command not found: path-test
sue@mizup% path=($path /home/sue/path:test)