Bug 1018822

Summary: ctrl+w closes the virt-manager window when working in the text console view
Product: [Fedora] Fedora Reporter: Chester Knapp <cknapp>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 20CC: berrange, cknapp, crobinso, hbrock, petersen, virt-maint, wbirkhea
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 284281 Environment:
Last Closed: 2014-02-27 17:56:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Screenshot showing binding to CTRL+W
none
binding_screenshot_2
none
binding_screenshot_3
none
binding_screenshot_4 none

Description Chester Knapp 2013-10-14 13:13:41 UTC
+++ This bug was initially created as a clone of Bug #284281 +++

Description of problem:
Could the close window binding (Ctrl-W) but changed to Ctrl-Shift-W
at least (assuming it is from virt-manager) since it is pretty annoying
in a shell in the console to press Ctrl-W and <woof/> the console is gone.
I actually did this by accident several times before realising what was
going on...

Version-Release number of selected component (if applicable):
virt-manager-0.4.0-2.fc7

How reproducible:
every time

Steps to Reproduce:
1. open a console window
2. press Ctrl-w (with focus in gnome-terminal say)
  
Actual results:
2. virtual console window closed

Expected results:
2. Ctrl-w to go to guest desktop

Additional info:
I wasn't able to test this with f8 (rawhide) yet - so this may be a devel
bug/rfe.

--- Additional comment from Daniel Berrange on 2007-09-27 17:31:07 EDT ---

Latest upstream code now blocks all window accelerator keys when using the console

http://hg.et.redhat.com/virt/applications/virt-manager--devel?cs=ef716036ca7f

Will pull into Fedora soon

--- Additional comment from Daniel Berrange on 2007-10-04 22:32:12 EDT ---

Now available in rawhide in virt-manager-0.5.2

Comment 1 Chester Knapp 2013-10-14 13:15:58 UTC
Filed on behalf of David Shunfenthal (dshunfen), who doesn't have BZ access...

Comment 2 Cole Robinson 2013-11-10 00:10:08 UTC
Thanks for the report, though FWIW opening a new bug is greatly preferred over reopening a six year old bug, the code is nearly 100% different at this point.

But I can't reproduce actually. Is this with the graphical connection or a text console connection (View->Text Consoles->...)? What virt-manager version is this? Can steps be provided to reproduce?

Comment 3 Chester Knapp 2013-11-12 15:17:43 UTC
(In reply to Cole Robinson from comment #2)
> Thanks for the report, though FWIW opening a new bug is greatly preferred
> over reopening a six year old bug, the code is nearly 100% different at this
> point.
> 
> But I can't reproduce actually. Is this with the graphical connection or a
> text console connection (View->Text Consoles->...)? What virt-manager
> version is this? Can steps be provided to reproduce?

Okay, I won't clone any old bugs. Here is the reporter's response: 

From: "David Shunfenthal" <dshunfen>
To: "Chester Knapp" <cknapp>
Sent: Tuesday, November 12, 2013 10:07:52 AM
Subject: Re: needinfo requested: [Bug 1018822] Ctrl-w in console closes console window

The real issue is that there is a shortcut (i.e. CTRL+W) that is bound to "Close Window". You can see this by clicking the file button and looking at the binding. For people who use the BASH console, this is a very big deal, because "ctrl+w" in the linux world is bound to the "logout" command in the console. So no matter which view (graphical or console) you are using, the window will close.

Repro steps:
1) Start up virt-manager
2) Start up a virtual machine.
3) Type "ctrl+w" in any window.

Also:
I am using version 0.10.0.
It can be either in the graphical or console views.

Attached is a screenshot showing the binding in the GUI on the "File" menu.

Best,

David Shunfenthal
dshunfen

Comment 4 Chester Knapp 2013-11-12 15:18:47 UTC
Created attachment 823020 [details]
Screenshot showing binding to CTRL+W

Comment 5 Cole Robinson 2013-11-12 16:31:59 UTC
Firstly, Chester, for your own sanity, please encourage David to open a bugzilla account, it's quite trivial from my recollection.

(In reply to Chester Knapp from comment #3)
> (In reply to Cole Robinson from comment #2)
> > Thanks for the report, though FWIW opening a new bug is greatly preferred
> > over reopening a six year old bug, the code is nearly 100% different at this
> > point.
> > 
> > But I can't reproduce actually. Is this with the graphical connection or a
> > text console connection (View->Text Consoles->...)? What virt-manager
> > version is this? Can steps be provided to reproduce?
> 
> Okay, I won't clone any old bugs. Here is the reporter's response: 
> 
> From: "David Shunfenthal" <dshunfen>
> To: "Chester Knapp" <cknapp>
> Sent: Tuesday, November 12, 2013 10:07:52 AM
> Subject: Re: needinfo requested: [Bug 1018822] Ctrl-w in console closes
> console window
> 
> The real issue is that there is a shortcut (i.e. CTRL+W) that is bound to
> "Close Window". You can see this by clicking the file button and looking at
> the binding. For people who use the BASH console, this is a very big deal,
> because "ctrl+w" in the linux world is bound to the "logout" command in the
> console. So no matter which view (graphical or console) you are using, the
> window will close.
> 

yes, 'close' has a ctrl+w shortcut. However, when connected to a VM graphical vnc/spice window and that window has grabbed keyboard input, we disable all keyboard accelerators so that any key combination is passed into the guest and ignored by virt-manager (except for certain things that we can't control like ctrl+alt+delete, since they are handled by the host X server and can't be disabled).

That aspect is working fine for me. As in, I cannot get into a situation where keystrokes are being sent to the guest (like typing at a terminal in the guest), where a subsequent ctrl+w closes the VM window.

This is only over the graphical vnc/spice window though (the default view), but infact ctrl+w _does_ close the window if I'm interacting with the guest serial console via View->Text Consoles->..., so that is definitely a bug.

However your report is also claiming that this affects the graphical console as well, which is far more worrying.

> Repro steps:
> 1) Start up virt-manager
> 2) Start up a virtual machine.
> 3) Type "ctrl+w" in any window.
> 
> Also:
> I am using version 0.10.0.

Please provide rpm -q virt-manager for full version info.

> It can be either in the graphical or console views.
> 
> Attached is a screenshot showing the binding in the GUI on the "File" menu.
> 

That screen shot is not of the VM details/console window so a bit misleading. But yes, ctrl+w does appear in the menus of the VM console window, but it should be disabled when the guest has grabbed keyboard input (as explained above).

What guest OS is this?
Please provide 'sudo virsh dumpxml $vmname'
And please provide step by step instructions for how to reproduce this with the graphical console, starting with a shutoff VM, what is clicked/typed and when.

Comment 6 Chester Knapp 2013-11-21 17:35:16 UTC
Created attachment 827389 [details]
binding_screenshot_2

Comment 7 Chester Knapp 2013-11-21 17:35:50 UTC
Created attachment 827390 [details]
binding_screenshot_3

Comment 8 Chester Knapp 2013-11-21 17:36:50 UTC
Created attachment 827391 [details]
binding_screenshot_4

Comment 9 Chester Knapp 2013-11-21 17:38:25 UTC
(In reply to Cole Robinson from comment #5)
> Firstly, Chester, for your own sanity, please encourage David to open a
> bugzilla account, it's quite trivial from my recollection.
> 
> (In reply to Chester Knapp from comment #3)
> > (In reply to Cole Robinson from comment #2)
> > > Thanks for the report, though FWIW opening a new bug is greatly preferred
> > > over reopening a six year old bug, the code is nearly 100% different at this
> > > point.
> > > 
> > > But I can't reproduce actually. Is this with the graphical connection or a
> > > text console connection (View->Text Consoles->...)? What virt-manager
> > > version is this? Can steps be provided to reproduce?
> > 
> > Okay, I won't clone any old bugs. Here is the reporter's response: 
> > 
> > From: "David Shunfenthal" <dshunfen>
> > To: "Chester Knapp" <cknapp>
> > Sent: Tuesday, November 12, 2013 10:07:52 AM
> > Subject: Re: needinfo requested: [Bug 1018822] Ctrl-w in console closes
> > console window
> > 
> > The real issue is that there is a shortcut (i.e. CTRL+W) that is bound to
> > "Close Window". You can see this by clicking the file button and looking at
> > the binding. For people who use the BASH console, this is a very big deal,
> > because "ctrl+w" in the linux world is bound to the "logout" command in the
> > console. So no matter which view (graphical or console) you are using, the
> > window will close.
> > 
> 
> yes, 'close' has a ctrl+w shortcut. However, when connected to a VM
> graphical vnc/spice window and that window has grabbed keyboard input, we
> disable all keyboard accelerators so that any key combination is passed into
> the guest and ignored by virt-manager (except for certain things that we
> can't control like ctrl+alt+delete, since they are handled by the host X
> server and can't be disabled).
> 
> That aspect is working fine for me. As in, I cannot get into a situation
> where keystrokes are being sent to the guest (like typing at a terminal in
> the guest), where a subsequent ctrl+w closes the VM window.
> 
> This is only over the graphical vnc/spice window though (the default view),
> but infact ctrl+w _does_ close the window if I'm interacting with the guest
> serial console via View->Text Consoles->..., so that is definitely a bug.
> 
> However your report is also claiming that this affects the graphical console
> as well, which is far more worrying.
> 
> > Repro steps:
> > 1) Start up virt-manager
> > 2) Start up a virtual machine.
> > 3) Type "ctrl+w" in any window.
> > 
> > Also:
> > I am using version 0.10.0.
> 
> Please provide rpm -q virt-manager for full version info.
> 
> > It can be either in the graphical or console views.
> > 
> > Attached is a screenshot showing the binding in the GUI on the "File" menu.
> > 
> 
> That screen shot is not of the VM details/console window so a bit
> misleading. But yes, ctrl+w does appear in the menus of the VM console
> window, but it should be disabled when the guest has grabbed keyboard input
> (as explained above).
> 
> What guest OS is this?
> Please provide 'sudo virsh dumpxml $vmname'
> And please provide step by step instructions for how to reproduce this with
> the graphical console, starting with a shutoff VM, what is clicked/typed and
> when.

From: "David Shunfenthal" <dshunfen>
To: "Chester Knapp" <chester>
Sent: Thursday, November 21, 2013 11:37:26 AM
Subject: Re: Happy birthday!

Chester,

Cole mentioned that he is having the problem with the console view, that when clicking ctrl+w it closes the window, and that that is a bug. Though, I am also having the same issue with the graphical view (which he says is not happening for him).

The repro steps (more detailed this time) are:

1) Start up virt-manager
2) I double-click my RHEL virtual machine called "RHEL" (see screenshot "binding_screenshot_2.jpg")
3) After the virtual machine boots up, I log in (by hitting enter and typing in the password for the VM)
4) After the login occurs, I have an icon on my taskbar that I click to open a terminal (see screenshot "binding_screenshot_3.jpg")
5) I attempt to close only the terminal window with the "ctrl+w" shortcut
6) Instead of closing the terminal window, it closes the entire graphical VM console (see screenshot "binding_screenshot_4.jpg")

One important thing that I want to point out is that I am not using KDE or gnome, I am using an X window manager called "i3". Could that be part of the problem?

Thanks very much,
David

P.S. Here is the output of the two commands Cole asked for:

[david@dshunfenthal ~]$ rpm -q virt-manager
virt-manager-0.10.0-4.fc19.noarch

[david@dshunfenthal ~]$ sudo virsh dumpxml RHEL
<domain type='kvm'>
  <name>RHEL</name>
  <uuid>8062890d-8c7f-d249-91a8-904d78926125</uuid>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='static'>4</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-1.4'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/home/david/virtual/RHEL.img'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </disk>
    <disk type='block' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <interface type='network'>
      <mac address='52:54:00:32:43:c4'/>
      <source network='default'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='spice' autoport='yes'/>
    <sound model='ich6'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='qxl' ram='65536' vram='65536' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </memballoon>
  </devices>
</domain>

Comment 10 Cole Robinson 2013-11-21 23:14:37 UTC
> 
> Chester,
> 
> Cole mentioned that he is having the problem with the console view, that
> when clicking ctrl+w it closes the window, and that that is a bug. Though, I
> am also having the same issue with the graphical view (which he says is not
> happening for him).
> 
> The repro steps (more detailed this time) are:
> 
> 1) Start up virt-manager
> 2) I double-click my RHEL virtual machine called "RHEL" (see screenshot
> "binding_screenshot_2.jpg")
> 3) After the virtual machine boots up, I log in (by hitting enter and typing
> in the password for the VM)
> 4) After the login occurs, I have an icon on my taskbar that I click to open
> a terminal (see screenshot "binding_screenshot_3.jpg")

> Thanks very much,
> David
> 



> 5) I attempt to close only the terminal window with the "ctrl+w" shortcut
> 6) Instead of closing the terminal window, it closes the entire graphical VM
> console (see screenshot "binding_screenshot_4.jpg")
> 
> One important thing that I want to point out is that I am not using KDE or
> gnome, I am using an X window manager called "i3". Could that be part of the
> problem?
> 

It is very likely this is at play here. I develop on gnome, but I've had half a dozen KDE/XFCE/LXDE/Awesome specific bugs over the years about little behavior differences or just something that we were tickling which was actually a bug in the desktop. Sounds plausible that's the case here.

However, I just installed i3 on Fedora 20, and still couldn't reproduce the issue. I have no idea how that desktop is expected to be used, it was pretty much just a blank screen for me: I had to ctrl+alt+f2, log in, and do DISPLAY=:0 virt-manager --debug  just to get something on the desktop. Once I did that, I started an F16 VM, logged into gnome in the VM, opened a terminal, ctrl+w was ignored by virt-manager, used ctrl+shift+w to kill the gnome-terminal in the guest, shutdown the VM, verified that after the VM was shutdown and the spice screen was closed ctrl+w worked to kill the virt-manager window. This is all expected behavior. I verified with an F20 spice guest, and with VNC as well.

Maybe F20 fixed the root issue in i3, or maybe it has something to do with any custom i3 config you use. But it doesn't seem to be an issue on virt-manager's side.

Let's use this bug to track the ctrl+w text console issue.

Comment 11 Cole Robinson 2013-12-18 21:31:59 UTC
The text console issue is fixed upstream, but it will be difficult to backport to f19, so moving this bug to f20

Comment 12 Cole Robinson 2014-02-27 17:56:24 UTC
This is fixed in virt-manager-1.0.0 in updates-testing