In the world of Ubuntu Gnome, you may sometimes encounter an issue where pressing
F4 switches to TTY4 instead of closing the active application window. This can be quite frustrating, especially if you’re used to using this shortcut to quickly close applications. In this article, we will discuss how to fix this issue and restore the normal behavior of
To fix the issue of Alt + F4 switching to TTY4 in Ubuntu Gnome, you can use a temporary solution by running the command "sudo kbd_mode -s" in the terminal. This restores the normal behavior of Alt + F4, but needs to be repeated after each boot. For a more permanent solution, you can edit the file "/etc/console-setup/remap.inc" and add the line "alt keycode 62 = VoidSymbol". After running "sudo dpkg-reconfigure console-setup -phigh" and rebooting your system, Alt + F4 should close the active application window as expected.
Understanding the Issue
Before we jump into the solution, let’s understand the issue. The problem arises when
F4 opens TTY4 instead of performing its usual function of closing the active window. This issue seems to be related to a kernel upgrade and has been reported on other Linux distributions as well.
A temporary solution to this problem involves running a specific command in the terminal. Open your terminal and type the following command:
sudo kbd_mode -s
kbd_mode command is used to report or set the keyboard mode. The
-s option sets the keyboard mode to “scancode” or “raw” mode. This restores the normal behavior of
However, this solution is temporary and needs to be repeated after each boot. If you want to switch back to “Unicode (UTF-8) mode”, you can use the following command:
sudo kbd_mode -u
-u option sets the keyboard mode to “Unicode (UTF-8)”.
For a more permanent solution, you can edit a specific file and add a line of code. Here are the steps:
- Open the terminal and type the following command to open the file as root:
sudo nano /etc/console-setup/remap.inc
nano command opens the nano text editor. The
sudo command is used to perform tasks that require administrative or root permissions.
- Add the following line at the bottom of the file:
alt keycode 62 = VoidSymbol
keycode 62 refer to the
F4 key combination. The
VoidSymbol effectively disables the action associated with this key combination.
- Save and close the file. In nano, you can do this by pressing
Yto confirm saving the changes, and finally
Enterto confirm the file name.
- Now, run the following command:
sudo dpkg-reconfigure console-setup -phigh
dpkg-reconfigure command reconfigures packages after they have already been installed. The
-phigh option specifies the priority of questions that should be asked.
- Finally, reboot your system. You can do this by typing the following command in the terminal:
After rebooting, the
F4 key combination should now close the active application window as expected.
In this article, we discussed how to fix the issue of
F4 switching to TTY4 in Ubuntu Gnome. We provided both a temporary and a permanent solution to this problem. While the temporary solution involves changing the keyboard mode, the permanent solution involves editing a file and adding a line of code. We hope this article has been helpful in resolving this issue. If you have any questions or need further assistance, feel free to ask in the comments section below.
This issue is related to a kernel upgrade and has been reported on other Linux distributions as well. It can be fixed by following the solutions mentioned in the article.
TTY4 refers to a virtual terminal in Linux. It is a text-based interface that allows you to interact with the system directly, without a graphical user interface.
The temporary solution involves changing the keyboard mode using the
kbd_mode command. This setting is not persistent and needs to be reapplied after each boot.
The permanent solution involves editing a configuration file and adding a line of code to disable the action associated with the Alt + F4 key combination. This ensures that the desired behavior is maintained even after system reboots.
Yes, you can switch back to the original keyboard mode by removing the line of code added to the configuration file, or by using the
sudo kbd_mode -u command to set the keyboard mode to "Unicode (UTF-8)".
No, applying the permanent solution should not cause any other issues. It simply modifies the behavior of the Alt + F4 key combination to close the active window, as intended.
Yes, rebooting the system is necessary for the changes to take effect. It ensures that the new configuration is applied and the Alt + F4 key combination behaves as expected.