about summary refs log tree commit diff stats
path: root/src/display
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
parentab7545d90ea7d45764d8358c32f719f40a050cda (diff)
downloadchawan-32abf37be768dd8dc831c5226bb974420c24ffd5.tar.gz
Add suspend() function (bound to C-z)
Diffstat (limited to 'src/display')
-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
rtik Agaram <vc@akkartik.com> 2019-09-07 10:14:35 -0700 committer Kartik Agaram <vc@akkartik.com> 2019-09-07 10:14:35 -0700 5635' href='/akkartik/mu/commit/debug_translate?h=main&id=571bf69fbc3bdfc82d2fa86391deb0d3b3b67560'>571bf69f ^
d9d9ab81 ^
d9d9ab81 ^
571bf69f ^

9e5e87ca ^
571bf69f ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28