hy3 icon indicating copy to clipboard operation
hy3 copied to clipboard

hyprland crashes for tabbed mode toggle

Open AnkitSeal2023 opened this issue 2 months ago • 4 comments

When I try to toggle off a tabbed window, when only that single window is open in the workspace, it crashes- it just logs me out from hyprland. But, if there's another window open, along with the tabbed window, it doesnt crash when i toggle off tabbed mode https://drive.google.com/file/d/1ho3Ta-CjFPKX2vE_ODJZHIaPHNxhW8Su/view?usp=sharing

AnkitSeal2023 avatar Oct 03 '25 18:10 AnkitSeal2023

I've been meaning to file an issue about this as well. I don't think it's just limited to the tabbed mode either. I think it's an issue when using the hy3:makegroup dispatcher with the toggle option enabled on a workspace with only one window. HY3 will correctly toggle make a group with the new layout but crash if you try to toggle that layout off.

This is kinda undefined behavior as far as I can tell, and I'm not sure what the solution would be. It could either refuse to toggle the layout since there is no parent layout or it could return to the default layout. Either makes some sense IMO, though I'd prefer returning to the default.

Nosamdaman avatar Oct 06 '25 16:10 Nosamdaman

some work arounds I've figured out if this issue occurs:

  1. move the window (hy3:movewindow) in any direction before toggling off the group.
  2. if you have already toggled off the group with a single window, and it has reached the "crashing" stage:
    • before hy3 crashes, move the window to another workspace, and comeback to the workspace again

AnkitSeal2023 avatar Oct 06 '25 18:10 AnkitSeal2023

I ran into crashes as well and started to use the pinned hl0.51.0 release, which seems to work perfectly fine for me.

Might be a different crash, but mine appeared directly after starting up and having some apps auto-start on different workspaces.

So, it seems that one of the three new commits introduced a bug. Since 3f314c62b6980074a1a1bade7da422b6e6e1d4be is about tab bars, it's somewhat reasonable to assume that this is the culprit.

Nukesor avatar Oct 07 '25 23:10 Nukesor

I've figured out that the problem is with the hy3:makegroup dispatcher and the toggle option. It leaves a gap related to the tab, which causes the crash. It only occurs when there is only one window left. The crash doesn't happen when I change the layout using hy3:changegroup, toggletab. I've written a bash script that temporarily fixes this issue:

#!/usr/bin/env bash
set -uo pipefail

# Run command and capture output exactly as printed
mapfile -t lines < <(hyprctl dispatch hy3:debugnodes)

# Must be exactly two lines
if [[ ${#lines[@]} -ne 2 ]]; then
  exit
fi

line1="${lines[0]}"
line2="${lines[1]}"

# Regexes (POSIX ERE for [[ =~ ]])
# 1) group(0xHEX) [splith] size ratio: 1, ephemeral
re1='^group\(0x[0-9a-fA-F]+\) \[tabs\] size ratio: 1, ephemeral$'

# 2) |-window(0xHEX) [hypr 0xHEX] size ratio: 1
#    allow optional spaces after "|-"
re2='^\|-[[:space:]]*window\(0x[0-9a-fA-F]+\) \[hypr 0x[0-9a-fA-F]+\] size ratio: 1$'

if [[ $line1 =~ $re1 && $line2 =~ $re2 ]]; then
  hyprctl dispatch hy3:changegroup untab
else
  hyprctl dispatch hy3:makegroup tab,toggle,force_ephemeral
fi

Finally run this script instead like this.

ErfanRasti avatar Oct 17 '25 10:10 ErfanRasti