[BUG]: focus-last-workspace doesn't work when switching workspaces with alt-tab #506

Closed
opened 2026-01-05 14:51:10 +01:00 by adam · 0 comments
Owner

Originally created by @gursuj on GitHub (Oct 25, 2024).

Summary

If I switch from ws1 to ws2 using the keybinds for focus-workspace, focus-last-workspace works as intended. But if I use alt-tab to switch to a window on a different workspace, focus-last-workspace stays on the same workspace.

Version Information

OS Name: Microsoft Windows 10 Home
OS Version: 10.0.19045 N/A Build 19045

komorebic 0.1.29
tag:v0.1.29
commit_hash:818ac340
build_time:2024-09-28 01:48:31 +00:00
build_env:rustc 1.81.0 (eeb90cda1 2024-09-04),stable-x86_64-pc-windows-msvc

Komorebi Configuration

{
  "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.24/schema.json",
  "app_specific_configuration_path": "$Env:USERPROFILE/applications.yaml",
  "window_hiding_behaviour": "Cloak",
  "cross_monitor_move_behaviour": "Insert",
  "default_workspace_padding": 0,
  "default_container_padding": 0,
  "border_padding": 0,
  "border_offset": 0,
  "border_width": 2,
  "border": true,
  "border_colours": {
    "single": "#fff",
    "stack": "#00a542",
    "monocle": "#ff3399"
  },
  "mouse_follows_focus": true,
  "monitors": [
    {
      "workspaces": [
        {
          "name": "1",
          "layout": "VerticalStack"
        },
        {
          "name": "2",
          "layout": "VerticalStack",
          "initial_workspace_rules": [
              {
                  "id": "firefox",
                  "kind": "Exe",
                  "matching_strategy": "Equals"
              }
          ]
        },
        {
          "name": "3",
          "layout": "VerticalStack"
        },
        {
          "name": "4",
          "layout": "VerticalStack"
        },
        {
          "name": "5",
          "layout": "VerticalStack"
        }
      ]
    }
  ],
  "float_rules": [
    {
      "kind": "Exe",
      "id": "Zebar.exe",
      "matching_strategy": "Equals"
    }, 
    {
        "kind": "Title",
        "id": "[Pp]icture.in.[Pp]icture",
        "matching_strategy": "Regex"
    }

  ],
  "stackbar": {
    "height": 20,
    "mode": "OnStack",
    "tabs": {
      "width": 300,
      "focused_text": "#00a542",
      "unfocused_text": "#b3b3b3",
      "background": "#141414"
    }
  }
}

Hotkey Configuration

.shell pwsh

# Reload whkd configuration
# alt + o                 : taskkill /f /im whkd.exe && start /b whkd # if shell is cmd
alt + o                 : taskkill /f /im whkd.exe; Start-Process whkd -WindowStyle hidden # if shell is pwsh / powershell
alt + shift + o         : komorebic reload-configuration

# App shortcuts - these require shell to be pwsh / powershell
# The apps will be focused if open, or launched if not open
alt + b                 : if ($wshell.AppActivate('Firefox') -eq $False) { start firefox }
# alt + b                 : if ($wshell.AppActivate('Chrome') -eq $False) { start chrome }
alt + escape            : start wt

# Focus windows
alt + h                 : komorebic focus left
alt + j                 : komorebic cycle-focus next
alt + k                 : komorebic cycle-focus previous
alt + l                 : komorebic focus right
# alt + shift + oem_4     : komorebic cycle-focus previous # oem_4 is [
# alt + shift + oem_6     : komorebic cycle-focus next # oem_6 is ]

# Move windows
alt + shift + h         : komorebic move left
alt + shift + j         : komorebic move down
alt + shift + k         : komorebic move up
alt + shift + l         : komorebic move right
alt + shift + return    : komorebic promote

# Stack windows
#alt + left              : komorebic stack left
#alt + down              : komorebic stack down
#alt + up                : komorebic stack up
#alt + right             : komorebic stack right
alt + oem_1             : komorebic unstack # oem_1 is ;
alt + oem_4             : komorebic cycle-stack previous # oem_4 is [
alt + oem_6             : komorebic cycle-stack next # oem_6 is ]

# Resize
alt + oem_plus          : komorebic resize-axis horizontal increase
alt + oem_minus         : komorebic resize-axis horizontal decrease
alt + shift + oem_plus  : komorebic resize-axis vertical increase
alt + shift + oem_minus : komorebic resize-axis vertical decrease

# Manipulate windows
alt + shift + f         : komorebic toggle-float
alt + f                 : komorebic toggle-maximize
alt + shift + c         : komorebic close
alt + d                 : komorebic minimize


# Window manager options
alt + shift + r         : komorebic retile
alt + p                 : komorebic toggle-pause

# Layouts
alt + x                 : komorebic flip-layout horizontal
alt + y                 : komorebic flip-layout vertical

# Workspaces
alt + 1                 : komorebic focus-workspace 0
alt + 2                 : komorebic focus-workspace 1
alt + 3                 : komorebic focus-workspace 2
alt + 4                 : komorebic focus-workspace 3
alt + 5                 : komorebic focus-workspace 4
alt + w                 : komorebic focus-last-workspace

# Move windows across workspaces
alt + shift + 1         : komorebic send-to-workspace 0
alt + shift + 2         : komorebic send-to-workspace 1
alt + shift + 3         : komorebic send-to-workspace 2
alt + shift + 4         : komorebic send-to-workspace 3
alt + shift + 5         : komorebic send-to-workspace 4

Output of komorebic check

KOMOREBI_CONFIG_HOME detected: C:\Users\sujal\.config\komorebi

Looking for configuration files in C:\Users\sujal\.config\komorebi

Found komorebi.json; this file can be passed to the start command with the --config flag

Found C:\Users\sujal\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag
Originally created by @gursuj on GitHub (Oct 25, 2024). ### Summary If I switch from ws1 to ws2 using the keybinds for `focus-workspace`, `focus-last-workspace` works as intended. But if I use alt-tab to switch to a window on a different workspace, `focus-last-workspace` stays on the same workspace. ### Version Information OS Name: Microsoft Windows 10 Home OS Version: 10.0.19045 N/A Build 19045 komorebic 0.1.29 tag:v0.1.29 commit_hash:818ac340 build_time:2024-09-28 01:48:31 +00:00 build_env:rustc 1.81.0 (eeb90cda1 2024-09-04),stable-x86_64-pc-windows-msvc ### Komorebi Configuration ```json { "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.24/schema.json", "app_specific_configuration_path": "$Env:USERPROFILE/applications.yaml", "window_hiding_behaviour": "Cloak", "cross_monitor_move_behaviour": "Insert", "default_workspace_padding": 0, "default_container_padding": 0, "border_padding": 0, "border_offset": 0, "border_width": 2, "border": true, "border_colours": { "single": "#fff", "stack": "#00a542", "monocle": "#ff3399" }, "mouse_follows_focus": true, "monitors": [ { "workspaces": [ { "name": "1", "layout": "VerticalStack" }, { "name": "2", "layout": "VerticalStack", "initial_workspace_rules": [ { "id": "firefox", "kind": "Exe", "matching_strategy": "Equals" } ] }, { "name": "3", "layout": "VerticalStack" }, { "name": "4", "layout": "VerticalStack" }, { "name": "5", "layout": "VerticalStack" } ] } ], "float_rules": [ { "kind": "Exe", "id": "Zebar.exe", "matching_strategy": "Equals" }, { "kind": "Title", "id": "[Pp]icture.in.[Pp]icture", "matching_strategy": "Regex" } ], "stackbar": { "height": 20, "mode": "OnStack", "tabs": { "width": 300, "focused_text": "#00a542", "unfocused_text": "#b3b3b3", "background": "#141414" } } } ``` ### Hotkey Configuration ``` .shell pwsh # Reload whkd configuration # alt + o : taskkill /f /im whkd.exe && start /b whkd # if shell is cmd alt + o : taskkill /f /im whkd.exe; Start-Process whkd -WindowStyle hidden # if shell is pwsh / powershell alt + shift + o : komorebic reload-configuration # App shortcuts - these require shell to be pwsh / powershell # The apps will be focused if open, or launched if not open alt + b : if ($wshell.AppActivate('Firefox') -eq $False) { start firefox } # alt + b : if ($wshell.AppActivate('Chrome') -eq $False) { start chrome } alt + escape : start wt # Focus windows alt + h : komorebic focus left alt + j : komorebic cycle-focus next alt + k : komorebic cycle-focus previous alt + l : komorebic focus right # alt + shift + oem_4 : komorebic cycle-focus previous # oem_4 is [ # alt + shift + oem_6 : komorebic cycle-focus next # oem_6 is ] # Move windows alt + shift + h : komorebic move left alt + shift + j : komorebic move down alt + shift + k : komorebic move up alt + shift + l : komorebic move right alt + shift + return : komorebic promote # Stack windows #alt + left : komorebic stack left #alt + down : komorebic stack down #alt + up : komorebic stack up #alt + right : komorebic stack right alt + oem_1 : komorebic unstack # oem_1 is ; alt + oem_4 : komorebic cycle-stack previous # oem_4 is [ alt + oem_6 : komorebic cycle-stack next # oem_6 is ] # Resize alt + oem_plus : komorebic resize-axis horizontal increase alt + oem_minus : komorebic resize-axis horizontal decrease alt + shift + oem_plus : komorebic resize-axis vertical increase alt + shift + oem_minus : komorebic resize-axis vertical decrease # Manipulate windows alt + shift + f : komorebic toggle-float alt + f : komorebic toggle-maximize alt + shift + c : komorebic close alt + d : komorebic minimize # Window manager options alt + shift + r : komorebic retile alt + p : komorebic toggle-pause # Layouts alt + x : komorebic flip-layout horizontal alt + y : komorebic flip-layout vertical # Workspaces alt + 1 : komorebic focus-workspace 0 alt + 2 : komorebic focus-workspace 1 alt + 3 : komorebic focus-workspace 2 alt + 4 : komorebic focus-workspace 3 alt + 5 : komorebic focus-workspace 4 alt + w : komorebic focus-last-workspace # Move windows across workspaces alt + shift + 1 : komorebic send-to-workspace 0 alt + shift + 2 : komorebic send-to-workspace 1 alt + shift + 3 : komorebic send-to-workspace 2 alt + shift + 4 : komorebic send-to-workspace 3 alt + shift + 5 : komorebic send-to-workspace 4 ``` ### Output of komorebic check ``` KOMOREBI_CONFIG_HOME detected: C:\Users\sujal\.config\komorebi Looking for configuration files in C:\Users\sujal\.config\komorebi Found komorebi.json; this file can be passed to the start command with the --config flag Found C:\Users\sujal\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag ```
adam added the bug label 2026-01-05 14:51:10 +01:00
adam closed this issue 2026-01-05 14:51:10 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#506