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

GUI: Ctrl + C doesn't work in scripting window [timebox: 4] #4736

Closed
DominicOram opened this issue Sep 13, 2019 · 7 comments
Closed

GUI: Ctrl + C doesn't work in scripting window [timebox: 4] #4736

DominicOram opened this issue Sep 13, 2019 · 7 comments

Comments

@DominicOram
Copy link
Contributor

As a user of GEM I would like to be able to stop a script with Ctrl+C in the scripting window. As part of this ticket we should introduce regression tests to make sure this doesn't happen again.

@DominicOram
Copy link
Contributor Author

DominicOram commented Sep 13, 2019

Note that this isn't broken on my developer machine or for @Tom-Willemsen but I have confirmed that it is currently broken on GEM.

@DominicOram
Copy link
Contributor Author

We should also try and find out if this is happening on other instrument machines

@Alistair-McGann-Tessella
Copy link

Alistair-McGann-Tessella commented Sep 20, 2019

I've tried copying the GEM client on to my machine, ctrl-c successfully stops a script. We need to have a closer look at the GEM instrument machine.

I've asked for permission from the the instrument scientists to have a look during the beam-off day next week, or whenever they have a free moment to get in touch

(Impeded until we get a look at the machine)

@Alistair-McGann-Tessella
Copy link

Alistair-McGann-Tessella commented Sep 25, 2019

Steps to reproduce the bug:

  1. Switch to scripting perspective
    1. Open a second console window
  2. Press reset layout button
  3. Ctrl+c no longer works and buffer reads 'NaN% full'

@Alistair-McGann-Tessella

We have spent a few days trying to find a solution to this bug, we need to repoint this and think about its priority.

This is a summary of the work done so far:
We think there is an issue in the IBEX codebase and not in PyDev itself, as the reset perspective button works in the latest version of eclipse and PyDev, but our reset layout button kills the scripting console view.

The IBEX reset layout button makes a direct call to resetPerspective() to reset the perspective/layout. We suspect that because this is gets the current workbench through an E3-style call (using PlatformUI), the pyDev console is not included in the page. This is then lost when resetPerspective() gets called. The relevant code is in uk.ac.stfc.isis.ibex.e4.ui.perspectiveswitcher/PerspectiveResetAdapter.java.

The eclipse 4 IDE codebase uses a different call to get the active workbench/page to reset the perspective:


@Override
public Object execute(ExecutionEvent event) {
IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
if (activeWorkbenchWindow != null) {
    WorkbenchPage page = (WorkbenchPage) activeWorkbenchWindow.getActivePage();
}
[...]
page.resetPerspective();

This method requires passing an ExecutionEvent to the handler, which is the E4 way of doing things. We have an unused handler in uk.ac.stfc.isis.ibex.e4.ui.perspectiveswitcher/ResetPerspective.java, so a possible solution is to convert this to the e4-style handler. This might allow it to function like the eclipse reset perspective menu item.

@Alistair-McGann-Tessella

image
This is a screenshot of the latest IBEX GUI with PyDev 7.3.0 after Reset Layout has been pressed. In the eclipse IDE, if you make a new perspective containing the same version of the PyDev console the console remains persistant over a 'Reset Perspective'. This is why I think that the issue is in how IBEX handles workspaces; the code to reset the perspective in the two cases is the same.

@Alistair-McGann-Tessella

I think there are probably around 3 points left on this ticket. This is because I expect getting an e4-style handler working in IBEX to be very fiddly.

@Tom-Willemsen Tom-Willemsen changed the title GUI: Ctrl + C doesn't work in scripting window GUI: Ctrl + C doesn't work in scripting window [timebox: 3] Oct 3, 2019
@John-Holt-Tessella John-Holt-Tessella added bucket proposals that didn't make into the sprint and removed support labels Oct 10, 2019
@Tom-Willemsen Tom-Willemsen changed the title GUI: Ctrl + C doesn't work in scripting window [timebox: 3] GUI: Ctrl + C doesn't work in scripting window [timebox: 4] Nov 7, 2019
@Kevin-Woods-Tessella Kevin-Woods-Tessella added this to the SPRINT_2019_11_07 milestone Nov 7, 2019
@Kevin-Woods-Tessella Kevin-Woods-Tessella removed the bucket proposals that didn't make into the sprint label Nov 7, 2019
@Tom-Willemsen Tom-Willemsen self-assigned this Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants