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

Unexpected crash when switching tabs #5

Closed
michaelrice opened this issue Apr 14, 2015 · 5 comments
Closed

Unexpected crash when switching tabs #5

michaelrice opened this issue Apr 14, 2015 · 5 comments

Comments

@michaelrice
Copy link

If I have tabbed windows and start pvc in window 1, then switch to window 2 pvc will crash

Traceback (most recent call last):
  File "/Users/errr/venvs/pvc/bin/pvc-tui", line 39, in <module>
    main()
  File "/Users/errr/venvs/pvc/bin/pvc-tui", line 36, in main
    app.run()
  File "/Users/errr/venvs/pvc/lib/python3.3/site-packages/pvc/core.py", line 139, in run
    if not self.login():
  File "/Users/errr/venvs/pvc/lib/python3.3/site-packages/pvc/core.py", line 99, in login
    code, fields = form.display()
  File "/Users/errr/venvs/pvc/lib/python3.3/site-packages/pvc/widget/form.py", line 86, in display
    **self.kwargs
  File "/Users/errr/venvs/pvc/lib/python3.3/site-packages/dialog.py", line 2188, in mixedform
    height, width, form_height, **kwargs)
  File "/Users/errr/venvs/pvc/lib/python3.3/site-packages/dialog.py", line 2032, in _generic_form
    (code, output) = self._perform(cmd, **kwargs)
  File "/Users/errr/venvs/pvc/lib/python3.3/site-packages/dialog.py", line 1389, in _perform
    child_output_rfd)
  File "/Users/errr/venvs/pvc/lib/python3.3/site-packages/dialog.py", line 1338, in _wait_for_program_termination
    child_output.strip()))
dialog.DialogError: dialog-like terminated due to an error: the dialog-like program exited with status 3 (which was passed to it as the DIALOG_ERROR environment variable). Sometimes, the reason is simply that dialog was given a height or width parameter that is too big for the terminal in use. Its output, with leading and trailing whitespace stripped, was:

If you need me to explain further let me know. Im currently running OSX and the default terminal app.

@dnaeon
Copy link
Owner

dnaeon commented Apr 14, 2015

Have you resized your terminal when using PVC?

The issue itself is not related to PVC, but to the dialog(1) backend and dialog(1) doesn't handle well terminal resize.

There's a bug reported about it here as well:

Unfortunately there is nothing we can do in PVC in order to prevent this as we are just using dialog(1) as the backend for displaying widgets and this should be fixed in dialog(1) itself.

What is the version of dialog(1) that you have installed?

@michaelrice
Copy link
Author

@dnaeon Im not resizing but that event could be being sent when switching tabs. Its not too big of a deal I can just run pvc in its own window to work around this as well.

As for dialog version: Version: 1.2-20130928

Since this isnt a bug in pvc please feel free to close it if you want.

Thanks!

@dnaeon
Copy link
Owner

dnaeon commented Apr 14, 2015

@michaelrice, could you please test with dialog-1.2-20150225 version and see how it works?

Here are short instructions how to build dialog-1.2-20150225 (just build, not install system-wide) and the needed changes to PVC.

  • Grab dialog-1.2-20150225 from ftp://invisible-island.net/dialog/dialog.tar.gz
  • Unzip dialog.tar.gz and build it
$ tar zxvf dialog.tar.gz
$ cd dialog-1.2-20150225
$ ./configure
$ make
  • Apply this patch to PVC
diff --git a/src/pvc/core.py b/src/pvc/core.py
index fdbe9d6..5e10fb5 100644
--- a/src/pvc/core.py
+++ b/src/pvc/core.py
@@ -47,7 +47,7 @@ class MainApp(object):

     """
     def __init__(self):
-        self.dialog = Dialog(autowidgetsize=True)
+        self.dialog = Dialog(autowidgetsize=True, dialog='/path/to/dialog-1.2-20150225/dialog')
         self.dialog.set_background_title(
             'Python vSphere Client version {}'.format(__version__)
         )
  • Run python setup.py install in your virtualenv
  • Start pvc-tui and try to crash it again

Something else that you could try and see if it still crashes is to set autowidgetsize=False in the above diff.

Let me know how it goes, when you have time to test it.

Thanks!

@dnaeon
Copy link
Owner

dnaeon commented Apr 16, 2015

@michaelrice, something else that popped up in my mind that I wanted to check with you.

What is your $TERM set to?

@dnaeon
Copy link
Owner

dnaeon commented Apr 25, 2015

@michaelrice I've also disabled mouse events for dialog(1), which seems to be causing some issues as well.

I will close this issue as it is not related to PVC itself, please update me when you have time to test the suggestions from this issue and the latest PVC version from the Github repo.

Thanks,
Marin

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

2 participants