Skip to content

Instantly share code, notes, and snippets.

@saitoha
saitoha / xpm2term.pl
Created April 23, 2012 11:49
きのう書いたやつ
#!/usr/bin/env perl
my %bank = ();
my $i = 0;
open (IN, $ARGV[0]) or die "cannot open specified file.";
foreach $line (<IN>) {
if ($line =~ /^"(..) c (#[A-Z0-9]{6})"/) {
$bank{$1} = $i;
print "\e]4;$i;$2\e\\";
$i++;
@saitoha
saitoha / u-nya-.pl
Created April 28, 2012 12:19
creeping chaos in the title bar.
#! /usr/bin/env perl
# -*- coding:utf-8 -*-
if (fork()) {
exit;
} else {
$| = 1;
while(1) {
print "\e]2; (」・ω・)」うー! \e\\";
sleep 1;
@saitoha
saitoha / u-nya-2.pl
Created May 5, 2012 05:18
端末のベンチマーク。minttyとputtyのwindows版だけはワイド幅文字のDECAWM挙動が変、iTerm2ではちょっと遅め、tanasinn(特にcygwin版)では非常に残念なパフォーマンスです。
#! /usr/bin/env perl
# -*- coding:utf-8 -*-
use strict;
sub initialize {
system "stty", '-icanon', 'eol', "\001";
print "\e[?7s\e[?7l\e[?1049h\e[?7l";
}
@saitoha
saitoha / vim_check_da2_sgr.txt
Created May 12, 2012 11:21
vim、SGRパッチ適用後のDA2チェック部分のロジック
#ifdef FEAT_TERMRESPONSE
if (key_name[0] == NUL
/* URXVT mouse uses <ESC>[#;#;#M, but we are matching <ESC>[ */
|| key_name[0] == KS_URXVT_MOUSE
|| key_name[0] == KS_SGR_MOUSE)
{
/* Check for xterm version string: "<Esc>[>{x};{vers};{y}c". Also
* eat other possible responses to t_RV, rxvt returns
* "<Esc>[?1;2c". Also accept CSI instead of <Esc>[.
@saitoha
saitoha / terminal.app.class-dump.diff
Created June 1, 2012 12:00
Terminal.app 2.2.3 (303.2) - 2.3 (307) class-dump diff
47c47
< TTMultiLineBuffer *_field1;
---
> id _field1;
118,119c118,119
< * File: /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal
< * UUID: 4FE3571C-852C-3F5E-BA6A-87B48ED5E043
---
> * File: /Users/user/Desktop/Terminal.app/Contents/MacOS/Terminal
> * UUID: 13F0FDE0-12F4-3F49-B45A-A551A5000E19
@saitoha
saitoha / vim-sgr-style.diff
Created June 2, 2012 10:40
SGR-styled mouse reporting. (for vim default branch).
diff -r 3d49d2dbb626 -r b3b924b5222d runtime/doc/eval.txt
--- a/runtime/doc/eval.txt Tue Jul 10 14:56:46 2012 +0200
+++ b/runtime/doc/eval.txt Tue Jul 10 22:17:33 2012 +0900
@@ -6296,6 +6296,7 @@
mouse_netterm Compiled with support for netterm mouse.
mouse_pterm Compiled with support for qnx pterm mouse.
mouse_sysmouse Compiled with support for sysmouse (*BSD console mouse)
+mouse_sgr Compiled with support for sgr mouse.
mouse_urxvt Compiled with support for urxvt mouse.
mouse_xterm Compiled with support for xterm mouse.
--- ext-mouse.el.bak 2012-05-04 19:11:15.000000000 +0900
+++ ext-mouse.el 2012-05-08 00:04:12.000000000 +0900
@@ -59,6 +59,8 @@
(defvar xterm-mouse-last)
+(defvar xterm-mouse-type "normal")
+
;; Mouse events symbols must have an 'event-kind property with
;; the value 'mouse-click.
@saitoha
saitoha / mouseterm-sgr-style.diff
Created June 2, 2012 13:22
SGR-styled mouse reporting. (for MouseTerm, https://bitheap.org/mouseterm/).
diff --git a/Japanese.lproj/Localizable.strings b/Japanese.lproj/Localizable.strings
new file mode 100644
index 0000000..02a8de8
--- /dev/null
+++ b/Japanese.lproj/Localizable.strings
@@ -0,0 +1,2 @@
+/* Send Mouse Events menu item */
+"Send Mouse Events" = "マウスイベントを送る";
diff --git a/MTParser.rl b/MTParser.rl
index e554262..7c80c85 100644
@saitoha
saitoha / Poderosa-urxvt-sgr-mouse-reporting.diff
Created June 5, 2012 15:24
Poderosa urxvt/SGR style mouse reporting patch for Poderosa 4.3.8b (https://sourceforge.net/projects/poderosa/)
Index: TerminalEmulator/XTerm.cs
===================================================================
RCS file: /cvsroot/poderosa/src/TerminalEmulator/XTerm.cs,v
retrieving revision 1.19
diff -u -r1.19 XTerm.cs
--- TerminalEmulator/XTerm.cs 27 May 2012 15:22:50 -0000 1.19
+++ TerminalEmulator/XTerm.cs 5 Jun 2012 01:05:55 -0000
@@ -29,6 +29,14 @@
Normal,
Drag,
@saitoha
saitoha / ck-mouse-reporting.diff
Created June 10, 2012 06:08
mouse reporting support for "cygwin ck terminal emulator" 3.3.4 (http://www.geocities.jp/meir000/ck/)
diff -ur ck-3.3.4.bak/src/app.cpp ck-3.3.4/src/app.cpp
--- ck-3.3.4.bak/src/app.cpp 2011-02-18 23:04:39.000000000 +0900
+++ ck-3.3.4/src/app.cpp 2012-06-10 14:15:30.119755200 +0900
@@ -203,11 +203,11 @@
}
return id;
}
-static HRESULT invoke_v(IDispatch* disp, DISPID id, UINT argc, VARIANTARG* argv){
+static HRESULT invoke_v(IDispatch* disp, DISPID id, UINT argc, VARIANTARG* argv, VARIANT *presult = NULL){
HRESULT hr=E_FAIL;