Skip to content

Instantly share code, notes, and snippets.

@saitoha
saitoha / mouseterm-extmouse-and-anyevent.diff
Created July 16, 2012 12:44
Support urxvt/SGR mouse reporting and "any event tracking mode". for MouseTerm
diff --git a/MTView.h b/MTView.h
index 490a8d6..2373679 100644
--- a/MTView.h
+++ b/MTView.h
@@ -13,6 +13,7 @@
- (BOOL) MouseTerm_shouldIgnore: (NSEvent*) event button: (MouseButton) button;
- (BOOL) MouseTerm_shouldIgnoreDown: (NSEvent*) event
button: (MouseButton) button;
+- (BOOL) MouseTerm_shouldIgnoreMoved: (NSEvent*) event;
- (Position) MouseTerm_currentPosition: (NSEvent*) event;
@saitoha
saitoha / matrix-sample.js
Created July 18, 2012 14:53
css transform 3D / get transfrom matrix from 2 vectors
/**
* @class Vector3d
*/
function Vector3d()
{
return this.initialize.apply(this, arguments);
};
Vector3d.prototype = {
x: 0,
@saitoha
saitoha / screen-osc-utf8.diff
Created July 19, 2012 13:31
Unicode(UTF-8) support for GNU Screen's OSC/AKA/hardstatus.
diff --git a/src/ansi.c b/src/ansi.c
index d88e153..fc42a0a 100644
--- a/src/ansi.c
+++ b/src/ansi.c
@@ -1493,8 +1493,24 @@ int c;
{
if (curr->w_stringp >= curr->w_string + MAXSTR - 1)
curr->w_state = LIT;
+# ifdef UTF8
+ else if (c < 0x80)
@saitoha
saitoha / vim-various-mark.diff
Created July 21, 2012 10:06
correct the mark for urxvt mouse (vim)
diff -r 11d40fc82f11 runtime/doc/various.txt
--- a/runtime/doc/various.txt Thu Jul 12 22:01:11 2012 +0200
+++ b/runtime/doc/various.txt Sat Jul 21 19:04:44 2012 +0900
@@ -355,7 +355,7 @@
B *+mouse_netterm* Unix only: netterm mouse handling |netterm-mouse|
N *+mouse_pterm* QNX only: pterm mouse handling |qnx-terminal|
N *+mouse_sysmouse* Unix only: *BSD console mouse handling |sysmouse|
-N *+mouse_urxvt* Unix only: urxvt mouse handling |urxvt-mouse|
+B *+mouse_urxvt* Unix only: urxvt mouse handling |urxvt-mouse|
N *+mouse_xterm* Unix only: xterm mouse handling |xterm-mouse|
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3790bfc..ff1f759 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -155,8 +155,56 @@ ${CMAKE_CURRENT_BINARY_DIR}/tests/CTestCustom.cmake)
target_link_libraries(konsoleprivate LINK_INTERFACE_LIBRARIES ${konsole_LIBS})
set(konsole_KDEINIT_SRCS
+ ${sessionadaptors_SRCS}
+ ${windowadaptors_SRCS}
@saitoha
saitoha / sgr-mouse-konsole.diff
Created July 28, 2012 14:03
SGR 1006 mouse tracking for Konsole (master:KONSOLE_VERSION=2.9.999)
diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp
index 82458aa..0ee4c62 100644
--- a/src/TerminalDisplay.cpp
+++ b/src/TerminalDisplay.cpp
@@ -2165,20 +2165,26 @@ void TerminalDisplay::mouseReleaseEvent(QMouseEvent* ev)
// applies here, too.
if (!_mouseMarks && !(ev->modifiers() & Qt::ShiftModifier))
- emit mouseSignal(3, // release
+ emit mouseSignal(0, // left button
@saitoha
saitoha / mouseterm-osc52-set.diff
Created August 4, 2012 21:20
OSC 52(Base64 Clipboard Access) / set access for mouseterm any-event-tracking branch(https://github.com/saitoha/mouseterm/tree/any-event-tracking)
diff --git a/English.lproj/Localizable.strings b/English.lproj/Localizable.strings
index 8995096..4610a47 100644
--- a/English.lproj/Localizable.strings
+++ b/English.lproj/Localizable.strings
@@ -1,2 +1,3 @@
/* Send Mouse Events menu item */
"Send Mouse Events" = "Send Mouse Events";
+"Enable Base64 Copy" = "Enable Base64 Copy";
diff --git a/French.lproj/Localizable.strings b/French.lproj/Localizable.strings
index 8a90845..93ca920 100644
@saitoha
saitoha / mouseterm-osc52-get.diff
Created August 5, 2012 07:48
OSC 52 get access for a MouseTerm branch (https://gist.github.com/3260028)
diff --git a/MTParser.rl b/MTParser.rl
index db85428..80f069c 100644
--- a/MTParser.rl
+++ b/MTParser.rl
@@ -1,6 +1,4 @@
#import <Cocoa/Cocoa.h>
-#import <apr-1/apr.h>
-#import <apr-1/apr_base64.h>
#import <math.h>
#import "Mouse.h"
@saitoha
saitoha / fix-for-terminal-app.sh
Created August 7, 2012 01:13
Fix for Terminal.app's autowrap & scroll issue (for less [+ tmux])
#!/bin/sh
infocmp -1|sed -e '/am,$/d' > /tmp/$TERM
tic -o ~/.terminfo/ /tmp/$TERM
@saitoha
saitoha / iterm2-osc52-set access.diff
Created August 11, 2012 18:15
OSC 52 set access for iTerm2
diff --git a/VT100Screen.h b/VT100Screen.h
index 4f46cdc..8a70e79 100644
--- a/VT100Screen.h
+++ b/VT100Screen.h
@@ -177,6 +177,7 @@ void StringToScreenChars(NSString *s,
- (BOOL) blinkingCursor;
- (void) setBlinkingCursor: (BOOL) flag;
+- (void)processOSC52: (NSString*) commandString;
- (void)showCursor:(BOOL)show;