Skip to content

Commit

Permalink
sandbox: only enable raw mode if stdin is associated with a tty
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 committed Aug 24, 2021
1 parent aa04277 commit b4e5fda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Library/Homebrew/sandbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def exec(*args)
seatbelt.close
@start = Time.now

$stdin.raw!
$stdin.raw! if $stdin.tty?
stdin_thread = T.let(nil, T.nilable(Thread))

begin
Expand All @@ -116,7 +116,7 @@ def exec(*args)
raise
ensure
stdin_thread&.kill
$stdin.cooked!
$stdin.cooked! if $stdin.tty?

seatbelt.unlink
sleep 0.1 # wait for a bit to let syslog catch up the latest events.
Expand Down

0 comments on commit b4e5fda

Please sign in to comment.