Undo shortcut CTRL+Z not working

Hi all,

Hopefully third one is the lucky one :slight_smile: So I'm having quite some troubles with the undo shortcut CTRL+Z. I first created this thread, and afterwards this.

Essentially, when I press this key combination, nothing happens. I tried several editors Kate, CLion, PyCharm, Chrome, etc. My global setting is set correctly, and all of the application menu buttons also point to the same shortcut. I've used xev to inspect what happens under the hood when keys are pressed. There I noticed some strange behavior. When any CTRL+<key> combination is pressed, there's the standard output of CTRL press, <key> press, <key> release, CTRL release, while in the case of CTRL+Z that is not the case. In the following screenshot please find the outputs of xev on CTRL+C and CTRL+Z.

I really hope that someone can help me with this one... It's quite frustrating doing anything without the undo shortcut...


You've said this has happened in many editors. Is it global? Like, could you use CTRL+Z in the Application Launcher or your web browser?

Yes, it seems to be global. I don't know what is the expected behavior in Application Launcher, but in web browser (Chrome and Firefoex), when in all of the text boxes, it still does not perform undo. I tested it also in this text box where I wrote the answer.

To be honest i don't know why you opened a new topic to cover the same thing, but ...
As i told you on the other post, where you find the shortcut ... It would be sensible logical, did you try to create an Alternate shortcut and see if that works? Have you tried a TEST (new user) and see if the same thing happens? Do you have the switching layout policy set to Global, Desktop, Application or Window?

I created a new topic since the previous ones got stale, and no one replied to my answers...

So I did find the shortcut in the settings menu, and it was set to CTRL+Z, as I replied in previous post. I also tested undo with another shortcut (ALT+Z), and it did work in some applications that used global shortcuts. PyCharm and Chrome for example still have CTRL+Z assigned for undo. Also I wouldn't be comfortable changing the shortcut in all of the apps.

Switching layout policy is set to global.

With a test user created from scratch, undo did work as it should, so this means that there's either some conflict or some installed app messed up the shortcuts. I run xev again in test user and the output is indeed different. There are now no FocusOut, FocusIn and KeymapNotify events instead of KeyPress. I have no idea what these events mean, and how and for which reason are they showing up... It also seems that this part everyone ignores...


What you ask "everyone else" is to find the needle in a stack of hay without a magnet. Even if you would have shared that as a text, is impossible to trace it on another machine.

See my example
KeyPress event, serial 40, synthetic NO, window 0x5c00001,
    root 0x1d7, subw 0x0, time 20809518, (218,685), root:(3100,714),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x5c00001,
    root 0x1d7, subw 0x0, time 20809910, (218,685), root:(3100,714),
    state 0x4, keycode 52 (keysym 0x7a, z), same_screen YES,
    XLookupString gives 1 bytes: (1a) "▒"
    XmbLookupString gives 1 bytes: (1a) "▒"
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x5c00001,
    root 0x1d7, subw 0x0, time 20810054, (218,685), root:(3100,714),
    state 0x4, keycode 52 (keysym 0x7a, z), same_screen YES,
    XLookupString gives 1 bytes: (1a) "▒"
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x5c00001,
    root 0x1d7, subw 0x0, time 20810118, (218,685), root:(3100,714),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

As you can see is totally different than yours, even from the test user you created, but since is working on that user, that means there is something in your user that overwrites the mapping to Ctrl+Z
The possibilities are quite numerous, and is impossible to start enumerating each and one of them, so you can check. You have to know what you did prior to this behavior started.
I could recommend to delete ~/.config/kglobalshortcutsrc but is not from there, because is impossible to have the same shortcut assigned twice for different tasks in KDE Plasma Shortcut settings.
Maybe you used dconf-editor just to test things and you changed something there.
Probably you used loadkeys to customize keyboard mapping, or by using xmodmap, or you tested xkb for custom keyboard and something is off ...

See what config/file is different from your user to the TEST user and maybe there is something in .xbindkeysrc (if you used that), or in .xinitrc ... because is definitely not a system wide issue, but restricted to your main user.

I see what you mean, but the issue is that I haven't used any specific program for key bindings, links, shortcuts etc.. I only used system settings provided in KDE... That's the reason why I don't know where to start from, and I really don't remember at which point did this start to occur, since I installed several apps at that stage of setting up the machine, and updated all the packages several times.

~/.config/kglobalshortcutsrc doesn't seem to have either undo or Ctrl+Z specified, .xbindkeysrc does not exist and .xinitrc seems quite generic:

_k_friendly_name=Activity Manager
switch-to-activity-b16c1867-b575-4915-af05-0f1ff870db20=none,none,Switch to activity "Default"

[KDE Keyboard Layout Switcher]
Switch keyboard layout to English (US)=none,none,Switch keyboard layout to English (US)
Switch keyboard layout to German (Neo qwerty)=none,none,Switch keyboard layout to German (Neo qwerty)
Switch keyboard layout to Serbian (Cyrillic, ZE and ZHE swapped)=none,none,Switch keyboard layout to Serbian (Cyrillic\\, ZE and ZHE swapped)
Switch keyboard layout to Serbian (Latin, QWERTY)=none,none,Switch keyboard layout to Serbian (Latin\\, QWERTY)
Switch to Next Keyboard Layout=Alt+X,none,Switch to Next Keyboard Layout
_k_friendly_name=KDE Daemon

Toggle Screen Reader On and Off=none,Meta+Alt+S,Toggle Screen Reader On and Off

Disable Touchpad=Touchpad Off,Touchpad Off,Disable Touchpad
Enable Touchpad=Touchpad On,Touchpad On,Enable Touchpad
Toggle Touchpad=Touchpad Toggle,Touchpad Toggle,Toggle Touchpad
_k_friendly_name=KDE Daemon

Show System Activity=Ctrl+Esc,Ctrl+Esc,Show System Activity
_k_friendly_name=KDE Daemon
display=Display\tMeta+P,Display\tMeta+P,Switch Display

_k_friendly_name=KDE Daemon
{0494c9c4-8593-4653-91a8-93bd01ce0018}=none,none,Take Active Window Screenshot
{33f9c790-d5a4-4026-b937-fd6ae12354c3}=none,none,Start Screenshot Tool
{385b5046-233c-431b-a452-7d68b6cb106c}=none,none,Take Full Screen Screenshot
{70abdcc3-c859-445f-afb9-f1560ba2d34c}=none,none,Take Rectangular Region Screenshot
{bcb93370-037e-4e79-b3cb-2473d315d17f}=Ctrl+Alt+T,none,Launch Konsole

_k_friendly_name=Audio Volume
decrease_microphone_volume=Microphone Volume Down,Microphone Volume Down,Decrease Microphone Volume
decrease_volume=Volume Down,Volume Down,Decrease Volume
increase_microphone_volume=Microphone Volume Up,Microphone Volume Up,Increase Microphone Volume
increase_volume=Volume Up,Volume Up,Increase Volume
mic_mute=Microphone Mute,Microphone Mute,Mute Microphone
mute=Volume Mute,Volume Mute,Mute

next_active_tab=none,none,Next Active Tab
toggle_mainwindow_visibility=none,none,Show/Hide Konversation

_k_friendly_name=Run Command
run command=Alt+Space\t\tSearch,Alt+Space,Run Command
run command on clipboard contents=Alt+Shift+F2,Alt+Shift+F2,Run Command on clipboard contents

Halt Without Confirmation=none,none,Halt Without Confirmation
Lock Session=Ctrl+Alt+L\tScreensaver,Ctrl+Alt+L\tScreensaver,Lock Session
Log Out=none,none,Log Out
Log Out Without Confirmation=none,none,Log Out Without Confirmation
Reboot Without Confirmation=none,none,Reboot Without Confirmation

Activate Window Demanding Attention=Ctrl+Alt+A,Ctrl+Alt+A,Activate Window Demanding Attention
Decrease Opacity=none,none,Decrease Opacity of Active Window by 5 %
Expose=Ctrl+F9,Ctrl+F9,Toggle Present Windows (Current desktop)
ExposeAll=Ctrl+F10\tLaunch (C),Ctrl+F10\tLaunch (C),Toggle Present Windows (All desktops)
ExposeClass=Ctrl+F7,Ctrl+F7,Toggle Present Windows (Window class)
Increase Opacity=none,none,Increase Opacity of Active Window by 5 %
Invert Screen Colors=none,none,Invert Screen Colors
Kill Window=Ctrl+Alt+Esc,Ctrl+Alt+Esc,Kill Window
MoveMouseToCenter=Meta+F6,Meta+F6,Move Mouse to Center
MoveMouseToFocus=Meta+F5,Meta+F5,Move Mouse to Focus
MoveZoomDown=none,none,Move Zoomed Area Downwards
MoveZoomLeft=none,none,Move Zoomed Area to Left
MoveZoomRight=none,none,Move Zoomed Area to Right
MoveZoomUp=none,none,Move Zoomed Area Upwards
Remove Window From Group=none,none,Remove Window From Group
Setup Window Shortcut=none,none,Setup Window Shortcut
Show Desktop=none,none,Show Desktop
ShowDesktopGrid=Ctrl+F8,Ctrl+F8,Show Desktop Grid
Suspend Compositing=Alt+Shift+F12,Alt+Shift+F12,Suspend Compositing
Switch One Desktop Down=Meta+Ctrl+Down,none,Switch One Desktop Down
Switch One Desktop Up=Meta+Ctrl+Up,none,Switch One Desktop Up
Switch One Desktop to the Left=Meta+Ctrl+Left,none,Switch One Desktop to the Left
Switch One Desktop to the Right=Meta+Ctrl+Right,none,Switch One Desktop to the Right
Switch Window Down=Meta+Alt+Down,Meta+Alt+Down,Switch to Window Below
Switch Window Left=Meta+Alt+Left,Meta+Alt+Left,Switch to Window to the Left
Switch Window Right=Meta+Alt+Right,Meta+Alt+Right,Switch to Window to the Right
Switch Window Up=Meta+Alt+Up,Meta+Alt+Up,Switch to Window Above
Switch to Desktop 1=Ctrl+F1,Ctrl+F1,Switch to Desktop 1
Switch to Desktop 10=none,none,Switch to Desktop 10
Switch to Desktop 11=none,none,Switch to Desktop 11
Switch to Desktop 12=none,none,Switch to Desktop 12
Switch to Desktop 13=none,none,Switch to Desktop 13
Switch to Desktop 14=none,none,Switch to Desktop 14
Switch to Desktop 15=none,none,Switch to Desktop 15
Switch to Desktop 16=none,none,Switch to Desktop 16
Switch to Desktop 17=none,none,Switch to Desktop 17
Switch to Desktop 18=none,none,Switch to Desktop 18
Switch to Desktop 19=none,none,Switch to Desktop 19
Switch to Desktop 2=Ctrl+F2,Ctrl+F2,Switch to Desktop 2
Switch to Desktop 20=none,none,Switch to Desktop 20
Switch to Desktop 3=Ctrl+F3,Ctrl+F3,Switch to Desktop 3
Switch to Desktop 4=Ctrl+F4,Ctrl+F4,Switch to Desktop 4
Switch to Desktop 5=none,none,Switch to Desktop 5
Switch to Desktop 6=none,none,Switch to Desktop 6
Switch to Desktop 7=none,none,Switch to Desktop 7
Switch to Desktop 8=none,none,Switch to Desktop 8
Switch to Desktop 9=none,none,Switch to Desktop 9
Switch to Next Desktop=none,none,Switch to Next Desktop
Switch to Next Screen=none,none,Switch to Next Screen
Switch to Previous Desktop=none,none,Switch to Previous Desktop
Switch to Previous Screen=none,none,Switch to Previous Screen
Switch to Screen 0=none,none,Switch to Screen 0
Switch to Screen 1=none,none,Switch to Screen 1
Switch to Screen 2=none,none,Switch to Screen 2
Switch to Screen 3=none,none,Switch to Screen 3
Switch to Screen 4=none,none,Switch to Screen 4
Switch to Screen 5=none,none,Switch to Screen 5
Switch to Screen 6=none,none,Switch to Screen 6
Switch to Screen 7=none,none,Switch to Screen 7
Toggle Window Raise/Lower=none,none,Toggle Window Raise/Lower
Walk Through Desktop List=none,none,Walk Through Desktop List
Walk Through Desktop List (Reverse)=none,none,Walk Through Desktop List (Reverse)
Walk Through Desktops=none,none,Walk Through Desktops
Walk Through Desktops (Reverse)=none,none,Walk Through Desktops (Reverse)
Walk Through Window Tabs=none,none,Walk Through Window Tabs
Walk Through Window Tabs (Reverse)=none,none,Walk Through Window Tabs (Reverse)
Walk Through Windows=Alt+Tab,none,Walk Through Windows
Walk Through Windows (Reverse)=Alt+Shift+Tab,none,Walk Through Windows (Reverse)
Walk Through Windows Alternative=none,none,Walk Through Windows Alternative
Walk Through Windows Alternative (Reverse)=none,none,Walk Through Windows Alternative (Reverse)
Walk Through Windows of Current Application=none,none,Walk Through Windows of Current Application
Walk Through Windows of Current Application (Reverse)=none,none,Walk Through Windows of Current Application (Reverse)
Walk Through Windows of Current Application Alternative=none,none,Walk Through Windows of Current Application Alternative
Walk Through Windows of Current Application Alternative (Reverse)=none,none,Walk Through Windows of Current Application Alternative (Reverse)
Window Above Other Windows=none,none,Keep Window Above Others
Window Below Other Windows=none,none,Keep Window Below Others
Window Close=Alt+F4,Alt+F4,Close Window
Window Fullscreen=none,none,Make Window Fullscreen
Window Grow Horizontal=none,none,Pack Grow Window Horizontally
Window Grow Vertical=none,none,Pack Grow Window Vertically
Window Lower=none,none,Lower Window
Window Maximize=Meta+PgUp,Meta+PgUp,Maximize Window
Window Maximize Horizontal=none,none,Maximize Window Horizontally
Window Maximize Vertical=none,none,Maximize Window Vertically
Window Minimize=Meta+PgDown,Meta+PgDown,Minimize Window
Window Move=none,none,Move Window
Window No Border=none,none,Hide Window Border
Window On All Desktops=none,none,Keep Window on All Desktops
Window One Desktop Down=Meta+Ctrl+Alt+Down,none,Window One Desktop Down
Window One Desktop Up=Meta+Ctrl+Alt+Up,none,Window One Desktop Up
Window One Desktop to the Left=Meta+Ctrl+Alt+Left,none,Window One Desktop to the Left
Window One Desktop to the Right=Meta+Ctrl+Alt+Right,none,Window One Desktop to the Right
Window Operations Menu=Alt+F3,Alt+F3,Window Operations Menu
Window Pack Down=none,none,Pack Window Down
Window Pack Left=none,none,Pack Window to the Left
Window Pack Right=none,none,Pack Window to the Right
Window Pack Up=none,none,Pack Window Up
Window Quick Tile Bottom=Meta+Down,Meta+Down,Quick Tile Window to the Bottom
Window Quick Tile Bottom Left=none,none,Quick Tile Window to the Bottom Left
Window Quick Tile Bottom Right=none,none,Quick Tile Window to the Bottom Right
Window Quick Tile Left=Meta+Left,Meta+Left,Quick Tile Window to the Left
Window Quick Tile Right=Meta+Right,Meta+Right,Quick Tile Window to the Right
Window Quick Tile Top=Meta+Up,Meta+Up,Quick Tile Window to the Top
Window Quick Tile Top Left=none,none,Quick Tile Window to the Top Left
Window Quick Tile Top Right=none,none,Quick Tile Window to the Top Right
Window Raise=none,none,Raise Window
Window Resize=none,none,Resize Window
Window Shade=none,none,Shade Window
Window Shrink Horizontal=none,none,Pack Shrink Window Horizontally
Window Shrink Vertical=none,none,Pack Shrink Window Vertically
Window to Desktop 1=none,none,Window to Desktop 1
Window to Desktop 10=none,none,Window to Desktop 10
Window to Desktop 11=none,none,Window to Desktop 11
Window to Desktop 12=none,none,Window to Desktop 12
Window to Desktop 13=none,none,Window to Desktop 13
Window to Desktop 14=none,none,Window to Desktop 14
Window to Desktop 15=none,none,Window to Desktop 15
Window to Desktop 16=none,none,Window to Desktop 16
Window to Desktop 17=none,none,Window to Desktop 17
Window to Desktop 18=none,none,Window to Desktop 18
Window to Desktop 19=none,none,Window to Desktop 19
Window to Desktop 2=none,none,Window to Desktop 2
Window to Desktop 20=none,none,Window to Desktop 20
Window to Desktop 3=none,none,Window to Desktop 3
Window to Desktop 4=none,none,Window to Desktop 4
Window to Desktop 5=none,none,Window to Desktop 5
Window to Desktop 6=none,none,Window to Desktop 6
Window to Desktop 7=none,none,Window to Desktop 7
Window to Desktop 8=none,none,Window to Desktop 8
Window to Desktop 9=none,none,Window to Desktop 9
Window to Next Desktop=none,none,Window to Next Desktop
Window to Next Screen=none,none,Window to Next Screen
Window to Previous Desktop=none,none,Window to Previous Desktop
Window to Previous Screen=none,none,Window to Previous Screen
Window to Screen 0=none,none,Window to Screen 0
Window to Screen 1=none,none,Window to Screen 1
Window to Screen 2=none,none,Window to Screen 2
Window to Screen 3=none,none,Window to Screen 3
Window to Screen 4=none,none,Window to Screen 4
Window to Screen 5=none,none,Window to Screen 5
Window to Screen 6=none,none,Window to Screen 6
Window to Screen 7=none,none,Window to Screen 7
view_actual_size=,Meta+0,Actual Size
view_zoom_in=Meta+=,Meta+=,Zoom In
view_zoom_out=Meta+-,Meta+-,Zoom Out

_k_friendly_name=Media Controller
mediavolumedown=none,none,Media volume down
mediavolumeup=none,none,Media volume up
nextmedia=Media Next,Media Next,Media playback next
playpausemedia=Media Play,Media Play,Play/Pause media playback
previousmedia=Media Previous,Media Previous,Media playback previous
stopmedia=Media Stop,Media Stop,Stop media playback

Decrease Keyboard Brightness=Keyboard Brightness Down,Keyboard Brightness Down,Decrease Keyboard Brightness
Decrease Screen Brightness=Monitor Brightness Down,Monitor Brightness Down,Decrease Screen Brightness
Increase Keyboard Brightness=Keyboard Brightness Up,Keyboard Brightness Up,Increase Keyboard Brightness
Increase Screen Brightness=Monitor Brightness Up,Monitor Brightness Up,Increase Screen Brightness
PowerOff=Power Off,Power Off,Power Off
Toggle Keyboard Backlight=Keyboard Light On/Off,Keyboard Light On/Off,Toggle Keyboard Backlight
_k_friendly_name=Power Management

activate task manager entry 1=Meta+1,Meta+1,Activate Task Manager Entry 1
activate task manager entry 10=Meta+0,Meta+0,Activate Task Manager Entry 10
activate task manager entry 2=Meta+2,Meta+2,Activate Task Manager Entry 2
activate task manager entry 3=Meta+3,Meta+3,Activate Task Manager Entry 3
activate task manager entry 4=Meta+4,Meta+4,Activate Task Manager Entry 4
activate task manager entry 5=Meta+5,Meta+5,Activate Task Manager Entry 5
activate task manager entry 6=Meta+6,Meta+6,Activate Task Manager Entry 6
activate task manager entry 7=Meta+7,Meta+7,Activate Task Manager Entry 7
activate task manager entry 8=Meta+8,Meta+8,Activate Task Manager Entry 8
activate task manager entry 9=Meta+9,Meta+9,Activate Task Manager Entry 9
activate widget 2=Alt+F1,none,Activate Application Launcher Widget
clear-history=none,none,Clear Clipboard History
clipboard_action=none,Ctrl+Alt+X,Enable Clipboard Actions
cycleNextAction=none,none,Next History Item
cyclePrevAction=none,none,Previous History Item
edit_clipboard=none,none,Edit Contents...
manage activities=Meta+Q,Meta+Q,Activities...
next activity=none,none,Walk through activities
previous activity=none,none,Walk through activities (Reverse)
repeat_action=none,Ctrl+Alt+R,Manually Invoke Action on Current Clipboard
show dashboard=Ctrl+F12,Ctrl+F12,Show Desktop
show-barcode=none,none,Show Barcode...
show-on-mouse-pos=none,none,Open Klipper at Mouse Position
stop current activity=Meta+S,Meta+S,Stop Current Activity

toggle-window-state=F12,F12,Open/Retract Yakuake
# ~/.xinitrc
# Executed by startx (run your window manager from here)



# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"

# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
    for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
        [ -x "$f" ] && . "$f"
    unset f

	local dbus_args=(--sh-syntax --exit-with-session)
	case $1 in
		awesome) dbus_args+=(awesome) ;;
		bspwm) dbus_args+=(bspwm-session) ;;
		budgie) dbus_args+=(budgie-desktop) ;;
		cinnamon) dbus_args+=(cinnamon-session) ;;
		deepin) dbus_args+=(startdde) ;;
		enlightenment) dbus_args+=(enlightenment_start) ;;
		fluxbox) dbus_args+=(startfluxbox) ;;
		gnome) dbus_args+=(gnome-session) ;;
		i3|i3wm) dbus_args+=(i3 --shmlog-size 0) ;;
		jwm) dbus_args+=(jwm) ;;
		kde) dbus_args+=(startkde) ;;
		lxde) dbus_args+=(startlxde) ;;
		lxqt) dbus_args+=(lxqt-session) ;;
		mate) dbus_args+=(mate-session) ;;
		xfce) dbus_args+=(xfce4-session) ;;
		openbox) dbus_args+=(openbox-session) ;;
		*) dbus_args+=($DEFAULT_SESSION) ;;

	echo "dbus-launch ${dbus_args[*]}"

exec $(get_session)

Do you have shortcuts set to Ctrl+< or Ctrl+> for something? Maybe related

Also it seems that KDE Plasma doesn't notify if there is a conflict with Ctrl+Z, so it can be attributed twice without notice, unusable in both instances tho ...

Try to restore to Defaults and see if that helps, or use the TEST user .config and .local folders and just get the necessary files and folders from your original user for your other applications.

I don't have those two shortcuts set, so that doesn't seem to be the issue.

What could be the damage if I bluntly copy/overwrite all of the /home/test/.config/* to /home/<user>/.config/*, and the same with .local/share?

If you do it while logged in, there will be errors, if you do it from tty, might work. Never had to do this myself. I always have backups.

I tried to copy all the files from .config and .local from test user to my user, but undo still doesn't work. Also I reverted all the shortcuts to defaults, still, no change. Additionally, I've set the same "custom" shortcuts that I applied weeks ago now to the test user, and those didn't break CTRL+Z as undo.

Now I'm completely lost... I haven't touched any of the "fancy" ways of changing the shortcuts, just used system settings menu. It somehow seems that some installed programs messed something up, but I really have zero idea...

Does anyone have? Maybe there are some other shortcut files in folders other then .config and .local?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by