Skip to content

Commit 534a840

Browse files
committed
The tailwindcss watch process must not steal keystrokes
which would break the debugger.
1 parent f77a0ce commit 534a840

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/tailwindcss/engine.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ class Engine < ::Rails::Engine
1616

1717
server do
1818
tailwind_pid = fork do
19-
exec(*Tailwindcss::Commands.watch_command(always: true))
19+
# To avoid stealing keystrokes from the debug gem's IRB console in the main process (which
20+
# needs to be able to read from $stdin), we use `IO.open(..., 'r+')`.
21+
IO.popen(Tailwindcss::Commands.watch_command, 'r+') do |io|
22+
IO.copy_stream(io, $stdout)
23+
end
2024
end
2125
at_exit do
2226
Process.kill(:INT, tailwind_pid)

0 commit comments

Comments
 (0)