entr
entr copied to clipboard
Can't enter interactive session with flags -r or -n
Consider this Python program:
$ cat test.py
import time
i = 0
while True:
time.sleep(1)
i+=1
print(i)
if i == 6:
import pdb; pdb.set_trace()
Running without flags works, and I can have my debugger session:
$ find app/ static/ -not \( -regex '.*\.pyc' -or -regex '.*\.swp' \) | entr python test.py
1
2
3
4
5
6
> /home/oznt/Software/tiny-cms/test.py(6)<module>()
-> time.sleep(1)
(Pdb) --KeyboardInterrupt--
(Pdb) l
1 import time
2 i = 0
3
4
5 while True:
6 -> time.sleep(1)
7 i+=1
8 print(i)
9 if i == 6:
10 import pdb; pdb.set_trace()
[EOF]
(Pdb) exit
Traceback (most recent call last):
File "test.py", line 6, in <module>
time.sleep(1)
File "test.py", line 6, in <module>
time.sleep(1)
File "/usr/lib64/python3.6/bdb.py", line 51, in trace_dispatch
return self.dispatch_line(frame)
File "/usr/lib64/python3.6/bdb.py", line 70, in dispatch_line
if self.quitting: raise BdbQuit
bdb.BdbQuit
However, pressing space has no effect:
$ find app/ static/ -not \( -regex '.*\.pyc' -or -regex '.*\.swp' \) | entr python test.py
1
2
3
4
5
6
> /home/oznt/Software/tiny-cms/test.py(6)<module>()
-> time.sleep(1)
(Pdb) exit
Traceback (most recent call last):
File "test.py", line 6, in <module>
time.sleep(1)
File "test.py", line 6, in <module>
time.sleep(1)
File "/usr/lib64/python3.6/bdb.py", line 51, in trace_dispatch
return self.dispatch_line(frame)
File "/usr/lib64/python3.6/bdb.py", line 70, in dispatch_line
if self.quitting: raise BdbQuit
bdb.BdbQuit
Now, running with -r - space reloads :
$ find app/ static/ -not \( -regex '.*\.pyc' -or -regex '.*\.swp' \) | entr -r python test.py
1
2
3
1
2
3
4
5
6
> /home/oznt/Software/tiny-cms/test.py(6)<module>()
-> time.sleep(1)
(Pdb)
Traceback (most recent call last):
File "test.py", line 6, in <module>
time.sleep(1)
File "test.py", line 6, in <module>
time.sleep(1)
File "/usr/lib64/python3.6/bdb.py", line 51, in trace_dispatch
return self.dispatch_line(frame)
File "/usr/lib64/python3.6/bdb.py", line 70, in dispatch_line
if self.quitting: raise BdbQuit
bdb.BdbQuit
However, the interactive debugger immediately stops. But without any flags, entr does not respond to file system event or the space key. Any idea?
Bummer, just found out what's the problem. From the project page::
First, the -r flag cannot be used with an interactive task:
This really belongs to the man page ...