about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--chat.h2
-rw-r--r--ui.c19
2 files changed, 21 insertions, 0 deletions
diff --git a/chat.h b/chat.h
index 43f62fd..76d69c9 100644
--- a/chat.h
+++ b/chat.h
@@ -111,6 +111,8 @@ void handle(struct Message msg);
 
 enum Heat { Cold, Warm, Hot };
 void uiInit(void);
+void uiShow(void);
+void uiHide(void);
 void uiDraw(void);
 void uiShowID(size_t id);
 void uiWrite(size_t id, enum Heat heat, const struct tm *time, const char *str);
diff --git a/ui.c b/ui.c
index b9aadec..072ee84 100644
--- a/ui.c
+++ b/ui.c
@@ -136,6 +136,24 @@ enum {
 	KeyPasteOff,
 };
 
+// XXX: Assuming terminals will be fine with these even if they're unsupported,
+// since they're "private" modes.
+static const char *EnterFocusMode = "\33[?1004h";
+static const char *ExitFocusMode  = "\33[?1004l";
+static const char *EnterPasteMode = "\33[?2004h";
+static const char *ExitPasteMode  = "\33[?2004l";
+
+void uiShow(void) {
+	putp(EnterFocusMode);
+	putp(EnterPasteMode);
+}
+
+void uiHide(void) {
+	putp(ExitFocusMode);
+	putp(ExitPasteMode);
+	endwin();
+}
+
 static void disableFlowControl(void) {
 	struct termios term;
 	int error = tcgetattr(STDOUT_FILENO, &term);
@@ -174,6 +192,7 @@ void uiInit(void) {
 	keypad(input, true);
 	nodelay(input, true);
 	windows.active = windowFor(Network);
+	//uiShow();
 }
 
 void uiDraw(void) {
a8b49b95&follow=1'>ui-shared: move about tab all the way to the leftJason A. Donenfeld 2014-01-17filter: don't forget to reap the auth filterJason A. Donenfeld 2014-01-17cgit.c: free tmp variableJason A. Donenfeld 2014-01-17Switch to exclusively using global ctxLukas Fleischer 2014-01-16auth: have cgit calculate login addressJason A. Donenfeld 2014-01-16auth: lua string comparisons are time invariantJason A. Donenfeld 2014-01-16authentication: use hidden form instead of refererJason A. Donenfeld 2014-01-16auth: add basic authentication filter frameworkJason A. Donenfeld 2014-01-16t0111: Additions and fixesLukas Fleischer 2014-01-16parsing.c: Remove leading space from committerLukas Fleischer