Fix style

This commit is contained in:
Sean Sullivan 2021-09-07 09:44:58 -07:00
parent c88f4c0645
commit c7b36df879

View File

@ -101,7 +101,6 @@ class Sandbox
command = [SANDBOX_EXEC, "-f", seatbelt.path, *args]
# Start sandbox in a pseudoterminal to prevent access of the parent terminal.
T.unsafe(PTY).spawn(*command) do |r, w, pid|
write_to_pty = proc {
# Set the PTY's window size to match the parent terminal.
# Some formula tests are sensitive to the terminal size and fail if this is not set.
winch = proc do |_sig|
@ -115,6 +114,7 @@ class Sandbox
end
end
write_to_pty = proc do
begin
# Update the window size whenever the parent terminal's window size changes.
old_winch = trap(:WINCH, &winch)
@ -129,9 +129,10 @@ class Sandbox
stdin_thread&.kill
trap(:WINCH, old_winch)
end
}
if $stdout.tty?
$stdin.raw &write_to_pty
end
if $stdin.tty?
$stdin.raw(&write_to_pty)
else
write_to_pty.call
end