Command line to return to the GUI after Ctrl-Alt-F1?

I’m unable to return to the GUI with Ctrl-Alt-F7 (or any of the 12 function keys). I have some unsaved work and I don’t want to lose them. Are there any other key combinations that will allow me to switch back?

Here is what I did:

  1. I pressed Ctrl-Alt-F1 and it showed a text-based login screen as usual
  2. Then I pressed Ctrl-Alt-F7 and it showed a screen full of text (I can’t remember what they were)
  3. Then I pressed Ctrl-Alt-F8 and it showed log messages that resembles /var/log/messages. Some entries are from automount, some from sendmail, and none are errors.
  4. Pressing any of the Ctrl-Alt-Fn combinations now has no effect. The cap-lock and num-lock LED no longer respond to their corresponding keys. I can use the mouse to highlight the text on the screen, but nothing else.

Any idea what happened?

I can still login to the system via SSH. GUI applications that I was using (e.g. opera) are still running and consuming tiny amounts of CPU as usual, as reported by top. Is it possible to switch back to the GUI via the command line? If possible, I don’t want to restart X, because doing so will kill all the GUI applications.

System info:

 Red Hat Enterprise Linux Client release 5.7
 Linux 2.6.18-238.12.1.el5 SMP x86_64
 gnome-desktop: 2.16.0-1.fc6
 xorg-x11-server-Xorg: 1.1.1-48.76.el5_7.5

Thanks to Shawn I was able to get back using chvt 9.

Further experiments shows that if I go to the 8th virtual terminal (either by Ctrl-Alt-F8 or chvt 8), I will not be able to switch to any other terminals using Ctrl-Alt-Fx keys. Now sure if this is a bug.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

chvt allows you to change your virtual terminal.

From man chvt:

The command chvt N makes /dev/ttyN the foreground terminal. (The
corresponding screen is created if it did not exist yet. To get rid of
unused VTs, use deallocvt(1).) The key combination (Ctrl-)LeftAlt-FN
(with N in the range 1-12) usually has a similar effect.

Method 2

Use the w command to find out which tty your X session uses, so you won’t need to guess which Fn to press.

Method 3

You can simply use Alt+F1 to return to your desktop.

Method 4

You can use Alt+F6 to return to your desktop in Fedora 26 and possibly other Wayland based Linux flavors.

Method 5

Toggle function-keys pressing “F-Lock” (german “F-Umsch”)

Stumpling right into the same problem, I’ve found the reason for – at least – my problem:
Using a ms natural 4000 keyboard sometimes requires to toggle the Function-keys pressing “F-Lock”-key located next to F12.

(Toggling the Function-Key’s might help with that type of keyboard too if you don’t get hardcopies etc…)


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x