Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't enter interactive session with flags -r or -n #14

Open
oz123 opened this issue Dec 31, 2020 · 1 comment
Open

Can't enter interactive session with flags -r or -n #14

oz123 opened this issue Dec 31, 2020 · 1 comment

Comments

@oz123
Copy link

oz123 commented Dec 31, 2020

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?

@oz123
Copy link
Author

oz123 commented Dec 31, 2020

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 ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant