8

What is the command to return to the graphical desktop after entering the terminal mode with Ctrl+Alt+F1? I need it for operating my Raspbian.

jasonwryan
  • 71,734
  • 34
  • 193
  • 226
aldorado
  • 625
  • 2
  • 11
  • 17

2 Answers2

13

On some systems it is Alt+F8 or Alt+F9, on others it is Alt+F7. The Ctrl is not needed to come back from the tty, only to drop to it.

The actual F key depends on which tty your X session is running in. As far as I know, the default value is 8 (or 7) so Alt+F8 should do it. If not, just try the other values until you hit the right one.

As @mantawork points out in the comments, a generic way is Alt+Left Arrow while in terminal 1. In general Alt+Left Arrow or Alt+Right Arrow will cycle through the ttys. If you repeat that you will eventually be taken back to the one that has your X session.

terdon
  • 234,489
  • 66
  • 447
  • 667
  • Which TTY it's on is very distro specific. Brand new installs can still use tty 7. – phemmer Oct 28 '13 at 18:01
  • @Patrick OK, I just used to always have 7 and now always have 8 so I thought it was A New Thing. Thanks, answer edited. – terdon Oct 28 '13 at 18:02
  • @Patrick seems to be DM-specific to me. I remember switching from LightDM to KDM and it switched from tty7 to tty8. Maybe dependent on _both_? – strugee Oct 28 '13 at 18:05
  • @strugee really? Huh, in which case I guess it was the switch to gdm2 that used the new one for me. I wonder why they would change that. – terdon Oct 28 '13 at 18:07
  • 2
    @strugee it depends on how X is getting started. If there is a specific init script for LightDM vs KDM, then yes, it could vary by display manager. However on my distro Xorg is started the exact same no matter the display manager. The display manager is started after X is up. – phemmer Oct 28 '13 at 18:07
  • Well anyway - On Raspbian it worked with Alt + F7 - thanks for your help! – aldorado Oct 28 '13 at 18:25
  • 2
    Or a generic way, supposing you have only one X session stared: Alt-F1, Alt-LeftArrow. – manatwork Oct 28 '13 at 18:31
  • @strugee it is not DM specific, but distro (and OS) specific. on FreeBSD, you always have to use CTRL, even to switch consoles. the number is determined by the number of used terminal set in /etc/inittab the DM used to be launched from the inittab actually. nowadays it is a parameter sent to Xorg. and if your Xorg is launched with -novtswitch like by default on Solaris, then you're screwed. or I have not found how to return to graphic. on Kubuntu you can switch user, and open new session, then you will have one X running on each tty, should be 7, 8, etc. but could be different. – Mathieu J. Mar 17 '15 at 23:04
  • For me `ALT + F1` works (Ubuntu 20.04 LTS, HP Zbook). See: https://unix.stackexchange.com/a/164253/437566 – Andreas L. Mar 21 '21 at 11:25
1

I had the same question/problem.

Alt-LeftArrow and Alt-RightArrow didn't do anything for me. They just printed ^[[C and ^[[D on the screen.

Mine ended up being Ctrl-Alt-F3. It varied depending on number of ttys that were configured in /etc/ttys. I had 2 uncommented ttys, so it was Ctrl-Alt-F3. When I uncommented another tty, it became Ctrl-Alt-F4.

Guest
  • 11
  • 1