Skip to content

Instantly share code, notes, and snippets.

@saitoha
saitoha / gist:3415651
Created August 21, 2012 13:54
VT340 Sixel Graphics Example (for RLogin/tanasinn/mlterm)
curl www.quadrantem.com/~k_wizard/vimprtan/20120423vimperator3.png | pngtopnm | pnmscale -xsize 200 | pnmquant 256 | ppmtosixel | perl -p -e 's/^\x90/\x1bP/' | perl -p -e 's/\x9C/\x1b\\/'
@saitoha
saitoha / yaft-on-mac.patch
Created August 22, 2012 12:26
yaft on mac
diff --git a/x/common.h b/x/common.h
index 9a264b3..9343344 100644
--- a/x/common.h
+++ b/x/common.h
@@ -3,9 +3,16 @@
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
+# if 0
#include <linux/fb.h>
@saitoha
saitoha / gist:3606583
Created September 3, 2012 03:36
iTerm2 Remote Clipboard Copy
function! s:ITerm2Copy() range
let l:tmp = @@
silent normal gvy
let l:selected = @@
let l:i = 0
let l:len = strlen(l:selected)
let l:escaped = ''
while l:i < l:len
let l:c = strpart(l:selected, l:i, 1)
let l:escaped .= printf("\\u%04x", char2nr(l:c))
@saitoha
saitoha / gist:3662533
Created September 7, 2012 01:58
tanasinn for Ascii Art
diff --git a/modules/session_components/line.js b/modules/session_components/line.js
index a1ee58f..7ee9e64 100644
--- a/modules/session_components/line.js
+++ b/modules/session_components/line.js
@@ -920,7 +920,7 @@ Line.definition = {
cell = cells[current];
is_normal = cell.c > 0 && cell.c < 256;
if (attr) {
- if (attr.equals(cell) && is_normal && !cell.drcs) {
+ if (attr.equals(cell) && (true || is_normal && !cell.drcs)) {
@saitoha
saitoha / vim-ttymouse-improvement.diff
Created September 12, 2012 10:13
Add support for has("mouse_urxvt"), has("mouse_sgr"), and Fix a bug in ttymouse auto-recognization
diff -r 1052677493be src/eval.c
--- a/src/eval.c Wed Sep 05 19:17:42 2012 +0200
+++ b/src/eval.c Wed Sep 12 19:09:44 2012 +0900
@@ -12274,9 +12274,15 @@
# ifdef FEAT_MOUSE_PTERM
"mouse_pterm",
# endif
+# ifdef FEAT_MOUSE_SGR
+ "mouse_sgr",
+# endif
@saitoha
saitoha / vim-term-xterm-256-rendition.diff
Created September 19, 2012 13:45
vim 256 color rendition in TERM=xterm
diff -r 91c52d4cb1be src/term.c
--- a/src/term.c Tue Sep 18 22:00:08 2012 +0200
+++ b/src/term.c Wed Sep 19 22:33:18 2012 +0900
@@ -2712,7 +2712,7 @@
/* Special handling of 16 colors, because termcap can't handle it */
/* Also accept "\e[3%dm" for TERMINFO, it is sometimes used */
/* Also accept CSI instead of <Esc>[ */
- if (n >= 8 && t_colors >= 16
+ if (n >= 8
&& ((s[0] == ESC && s[1] == '[') || (s[0] == CSI && (i = 1) == 1))
@saitoha
saitoha / tmux-disable-decscl.diff
Created September 20, 2012 13:07
Disable changing terminal mode to VT class 1.
diff --git a/tty.c b/tty.c
index 68d130c..12d79be 100644
--- a/tty.c
+++ b/tty.c
@@ -289,9 +289,6 @@ tty_stop_tty(struct tty *tty)
tty_raw(tty, "\033[?1000l");
tty_raw(tty, tty_term_string(tty->term, TTYC_RMCUP));
-
- if (tty->xterm_version > 270)
@saitoha
saitoha / map-minus.diff
Created September 20, 2012 15:17
vimperator issue: "map - <something>" does not works
diff -ruN a/common/content/commands.js b/common/content/commands.js
--- a/common/content/commands.js 2012-08-04 07:41:20.000000000 +0900
+++ b/common/content/commands.js 2012-09-21 00:09:47.000000000 +0900
@@ -703,7 +703,7 @@
liberator.echoerr("Error parsing arguments: " + arg);
return null;
} // if /^\s*-/ is NOT TRUE, "-" be quoted.
- else if (!onlyArgumentsRemaining && /^-/.test(arg) && /^\s*-/.test(sub)) {
+ else if (!onlyArgumentsRemaining && /^-/.test(arg) && /^\s*-\S/.test(sub)) {
liberator.echoerr("Invalid option: " + arg);
@saitoha
saitoha / mined-fix-dsr-cpr-timeout.diff
Created September 28, 2012 14:46
Fix timeout for DSR-CPR for mined
Binary files a/src/.mined1.c.un~ and b/src/.mined1.c.un~ differ
diff -urN a/src/mined1.c b/src/mined1.c
--- a/src/mined1.c 2012-09-28 23:43:29.000000000 +0900
+++ b/src/mined1.c 2012-09-28 23:42:59.000000000 +0900
@@ -1340,7 +1340,7 @@
terminal lines can be acquired but the user delay on a
terminal that doesn't respond at all remains acceptable.
*/
-static int escape_delay = 0; /* wait to detect escape sequence */
+static int escape_delay = 30; /* wait to detect escape sequence */
@saitoha
saitoha / mined-fix-for-tmux.diff
Created September 29, 2012 00:47
MinEd / Fix for tmux
diff -ruN a/src/mined1.c b/src/mined1.c
--- a/src/mined1.c 2012-09-28 23:43:29.000000000 +0900
+++ b/src/mined1.c 2012-09-29 09:45:00.000000000 +0900
@@ -2481,8 +2481,6 @@
acquire_device_attributes ();
if (terminal_type == 'S') { /* screen */
screen_version = terminal_version / 100;
- } else if (strisprefix ("screen", TERM)) {
- screen_version = 1;
}