File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 3
3
* Fix binstubs not being replaced when their quoting style was changed (#534 )
4
4
* Preserve comments right after the shebang line which might include magic comments such as `frozen_string_literal: true'
5
5
* Fix binstub failures when Bundler's ` BUNDLE_APP_CONFIG ` environment variable is present (#545 )
6
+ * Properly suspend and resume on ctrl-z TSTP and CONT (#361 )
6
7
7
8
## 2.0.2
8
9
Original file line number Diff line number Diff line change @@ -161,6 +161,8 @@ def run_command(client, application)
161
161
if pid && !pid . empty?
162
162
log "got pid: #{ pid } "
163
163
164
+ suspend_resume_on_tstp_cont ( pid )
165
+
164
166
forward_signals ( application )
165
167
status = application . read . to_i
166
168
@@ -181,6 +183,18 @@ def queue_signals
181
183
end
182
184
end
183
185
186
+ def suspend_resume_on_tstp_cont ( pid )
187
+ trap ( "TSTP" ) {
188
+ log "suspended"
189
+ Process . kill ( "STOP" , pid . to_i )
190
+ Process . kill ( "STOP" , Process . pid )
191
+ }
192
+ trap ( "CONT" ) {
193
+ log "resumed"
194
+ Process . kill ( "CONT" , pid . to_i )
195
+ }
196
+ end
197
+
184
198
def forward_signals ( application )
185
199
@signal_queue . each { |sig | kill sig , application }
186
200
You can’t perform that action at this time.
0 commit comments