about summary refs log tree commit diff stats
path: root/src/display/client.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-07-26 00:00:54 +0200
committerbptato <nincsnevem662@gmail.com>2023-07-26 00:00:54 +0200
commit32abf37be768dd8dc831c5226bb974420c24ffd5 (patch)
treee836d233ce5bbb266fedf18b53267f572e3f79d2 /src/display/client.nim
parentab7545d90ea7d45764d8358c32f719f40a050cda (diff)
downloadchawan-32abf37be768dd8dc831c5226bb974420c24ffd5.tar.gz
Add suspend() function (bound to C-z)
Diffstat (limited to 'src/display/client.nim')
-rw-r--r--src/display/client.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/display/client.nim b/src/display/client.nim
index a292bf0a..5b961841 100644
--- a/src/display/client.nim
+++ b/src/display/client.nim
@@ -154,6 +154,11 @@ proc command(client: Client, src: string) =
   client.console.container.requestLines().then(proc() =
     client.console.container.cursorLastLine())
 
+proc suspend(client: Client) {.jsfunc.} =
+  client.pager.term.quit()
+  discard kill(getpid(), cint(SIGSTOP))
+  client.pager.term.restart()
+
 proc quit(client: Client, code = 0) {.jsfunc.} =
   if client.alive:
     client.alive = false