how do I make function keys switch to different terminals in console mode?

Without running any window manager, just logged in directly to the box in the first terminal session, how can I make F2, F3, F4, etc switch to other terminal "tabs"?

i.e. not using screen or tmux

I seem to remember old unix systems doing this from years ago, but is this still possible with a base arch linux system today?

1

1 Answer

What you describe is called a Virtual Terminal aka VT

Most distributions support switching to a different VT with Alt+F1 , Alt+F2, etc

A graphical environment (X-window) is just one of those VTs, often 6th or 7th.

To switch from an X-Window session to another VT you need to press Alt+Ctrl+F1, e t.c. (unless this is forbidden through novtswitch option)

I don't remember bare F1, F2, etc ever switching VTs, but you can make them behave like that. Enter following from a root text VT (X-window terminal emulater won't do):

#loadkeys
keycode 59 = Console_1
keycode 60 = Console_2
.......
keycode 69 = Console_10

Press Ctrl+D to finish input

To reapply those changes on reboot, save above to a file and refer to your distro documentation on keymaps, such as this page on ArchLinux wiki

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like