prompt-toolkit / pymux

A terminal multiplexer (like tmux) in Python
BSD 3-Clause "New" or "Revised" License
1.45k stars 82 forks source link

pymux ui freezed #74

Open wonderbeyond opened 6 years ago

wonderbeyond commented 6 years ago

I do some keystrokes I cant remember, then pymux stops responding.

After a minute, I killed the process. I can see a crash log:

$ cat /tmp/pymux.crash-fnlkdd0i  
Traceback (most recent call last):
  File "/home/wonder/.local/lib/python3.5/site-packages/pymux/main.py", line 538, in run_server
    PipeInput(), DummyCallbacks())
  File "/home/wonder/.local/lib/python3.5/site-packages/prompt_toolkit/eventloop/posix.py", line 159, in run
    t()
  File "/home/wonder/.local/lib/python3.5/site-packages/pymux/process.py", line 291, in _read
    process()
  File "/home/wonder/.local/lib/python3.5/site-packages/pymux/process.py", line 285, in process
    self.stream.feed(d)
  File "/home/wonder/.local/lib/python3.5/site-packages/pymux/stream.py", line 99, in feed
    taking_plain_text = send(chars[i])
  File "/home/wonder/.local/lib/python3.5/site-packages/pymux/stream.py", line 183, in _parser_generator
    basic_dispatch[char]()
  File "/home/wonder/.local/lib/python3.5/site-packages/pymux/screen.py", line 725, in bell
    self.bell_func()
  File "/home/wonder/.local/lib/python3.5/site-packages/pymux/main.py", line 241, in bell
    for c in self.clis.values():
RuntimeError: dictionary changed size during iteration
espoelstra commented 4 years ago

In some shells Ctrl+s and Ctrl+q pause and resume input and output so if the shell gets the keystroke instead of pymux it will stop sending anything to the foreground process and this may cause the failure you are seeing.

I used to run into this frequently while working in vim because switching between files in splits uses Ctrl+w which is right between Ctrl+s and Ctrl+q.