Commit Diff


commit - bae22522f4ba541153fa7bf9aa18b11f141dc4b9
commit + 8a3b560980a56fecd37e28e56f8ddeb3fa36e449
blob - 567015ddcda859e1cf828c5f37e40fc1d2dc869f
blob + e4b79d77d4acac692396bbeda69607b0571807bf
--- cmd.c
+++ cmd.c
@@ -841,3 +841,10 @@ cmd_insert_current_candidate(struct buffer *buffer)
 	strlcpy(ministate.buf, vl->parent->line, sizeof(ministate.buf));
 	ministate.buffer.cpoff = utf8_cplen(ministate.buf);
 }
+
+void
+cmd_suspend_telescope(struct buffer *buffer)
+{
+	message("Zzz...");
+	ui_suspend();
+}
blob - a1067cfce1c23c8a6c2bfa58e2d1f7ed806b0429
blob + ae85dbc7afa4f76e0d67106c23c4ec2d77b26fa6
--- cmd.h
+++ cmd.h
@@ -48,6 +48,7 @@ CMD(cmd_scroll_down);
 CMD(cmd_scroll_line_down);
 CMD(cmd_scroll_line_up);
 CMD(cmd_scroll_up);
+CMD(cmd_suspend_telescope);
 CMD(cmd_swiper);
 CMD(cmd_tab_close);
 CMD(cmd_tab_close_other);
blob - bb65a4983ba4f5c37701e938162ee2701240a965
blob + d32a264c21d4d6efff53f76f235fa33a5041da2f
--- ui.c
+++ ui.c
@@ -1322,6 +1322,18 @@ ui_read(const char *prompt, void (*fn)(const char*, st
 {
 	completing_read(prompt, fn, data);
 	redraw_tab(current_tab());
+}
+
+void
+ui_suspend(void)
+{
+	endwin();
+
+	kill(getpid(), SIGTSTP);
+
+	refresh();
+	clear();
+	rearrange_windows();
 }
 
 void
blob - 27a5a9566994a2bb2d1242a03d79a4df03d1dcd3
blob + d5244262d5a1a313f8fa64fa09647437b3a67a89
--- ui.h
+++ ui.h
@@ -120,6 +120,7 @@ void		 ui_schedule_redraw(void);
 void		 ui_require_input(struct tab *, int);
 void		 ui_read(const char *, void (*)(const char *, struct tab *), struct tab *);
 void		 ui_yornp(const char *, void (*)(int, struct tab *), struct tab *);
+void		 ui_suspend(void);
 void		 ui_end(void);
 
 #endif