broot icon indicating copy to clipboard operation
broot copied to clipboard

i3-wm: No resize event when broot started together with a terminal emulator

Open gl4eqen opened this issue 3 years ago • 5 comments

Describe the bug When broot is started together with a terminal emulator (tested with alacritty and xterm) on i3-wm (could not reproduce the bug on dwm) it does not fill the terminal emulator's window.

To Reproduce

  • Start terminal emulator together with broot
$ alacritty -e broot
# or
$ xterm -e broot

Expected behavior broot should fill terminal emulator's window.

broot.log

19:23:50.943 [INFO] cli_log::init: Starting broot v1.3.1 with log level DEBUG
19:23:50.943 [DEBUG] broot::shell_install: Shell script already installed. Doing nothing.
19:23:50.943 [DEBUG] broot::cli: Conf::from_default_location() took 187.456µs
19:23:50.943 [DEBUG] broot::cli: config: Conf {
    files: [
        "/home/glaeqen/.config/broot/conf.hjson",
    ],
    default_flags: Some(
        "g",
    ),
    date_time_format: None,
    verbs: [
        VerbConf {
            invocation: Some(
                "edit",
            ),
            internal: None,
            external: None,
            execution: Some(
                String(
                    "$EDITOR +{line} {file}",
                ),
            ),
            cmd: None,
            cmd_separator: None,
            key: Some(
                "F2",
            ),
            keys: [],
            shortcut: Some(
                "e",
            ),
            leave_broot: Some(
                false,
            ),
            from_shell: None,
            apply_to: None,
            set_working_dir: None,
            description: None,
        },
        VerbConf {
            invocation: Some(
                "create {subpath}",
            ),
            internal: None,
            external: None,
            execution: Some(
                String(
                    "$EDITOR {directory}/{subpath}",
                ),
            ),
            cmd: None,
            cmd_separator: None,
            key: None,
            keys: [],
            shortcut: None,
            leave_broot: Some(
                false,
            ),
            from_shell: None,
            apply_to: None,
            set_working_dir: None,
            description: None,
        },
        VerbConf {
            invocation: Some(
                "git_diff",
            ),
            internal: None,
            external: None,
            execution: Some(
                String(
                    "git difftool -y {file}",
                ),
            ),
            cmd: None,
            cmd_separator: None,
            key: None,
            keys: [],
            shortcut: Some(
                "gd",
            ),
            leave_broot: Some(
                false,
            ),
            from_shell: None,
            apply_to: None,
            set_working_dir: None,
            description: None,
        },
        VerbConf {
            invocation: Some(
                "terminal",
            ),
            internal: None,
            external: None,
            execution: Some(
                String(
                    "$SHELL",
                ),
            ),
            cmd: None,
            cmd_separator: None,
            key: Some(
                "ctrl-t",
            ),
            keys: [],
            shortcut: None,
            leave_broot: Some(
                false,
            ),
            from_shell: None,
            apply_to: None,
            set_working_dir: Some(
                true,
            ),
            description: None,
        },
    ],
    skin: None,
    special_paths: {},
    search_modes: None,
    disable_mouse_capture: None,
    cols_order: None,
    show_selection_mark: None,
    ext_colors: {},
    syntax_theme: None,
    true_colors: None,
    icon_theme: Some(
        "vscode",
    ),
    modal: None,
    max_panels_count: None,
}
19:23:50.946 [DEBUG] broot::app::app_context: COLORTERM env variable = "truecolor"
19:23:50.946 [DEBUG] broot::app::app_context: true colors are available
19:23:50.947 [DEBUG] broot::tree_build::builder: GitIgnorer::default() took 1.467µs
19:23:50.947 [DEBUG] broot::tree_build::builder: init line_status_computer took 77.105µs
19:23:50.949 [DEBUG] broot::tree_build::builder: trimming prematurely interrupted
19:23:50.954 [DEBUG] broot::app::app: display panel took 222.377µs
19:23:50.954 [DEBUG] broot::app::app: pending_tasks took 1.397µs

Screenshots Alacritty Screenshot from 2021-05-03 19-08-37 Xterm Screenshot from 2021-05-03 18-41-43

Configuration (please complete the following information):

  • broot version: 1.3.1
  • OS: Arch Linux
  • DE: Regolith Linux (i3-wm based), problem also reproduced in vanilla i3-wm
  • Relevant configuration items
    • Problem does not seem to be dependent on a configuration of aforementioned programs

Additional context None

gl4eqen avatar May 03 '21 17:05 gl4eqen

Precision: As seen together in the log, broot doesn't receive any resize event in this configuration.

Canop avatar May 03 '21 17:05 Canop

Precision: As seen together in the log, broot doesn't receive any resize event in this configuration.

EDIT: Yes, forgot to add broot.log. Fixed now.

gl4eqen avatar May 03 '21 17:05 gl4eqen

I reproduce this exact problem. It looks like i3 silently resizes after broot finishes loading.

A tested workaround is to delay broot launches with a script containing a sleep.

Broot could incorporate a configurable delay before checking again the dimensions but I'm quite reluctant to add such a hack at this point as it really looks like a i3 bug.

Canop avatar May 05 '21 17:05 Canop

@Canop

it really looks like a i3 bug.

It's interesting because it seems like broot has issues with this initial resizing in sway as well. It looks like sway is so compatible with i3-wm, it also implements original bugs. Unless this resizing problem is actually part of i3-wm design. Hmm.

gl4eqen avatar May 28 '21 11:05 gl4eqen

I cannot repro on my side when using Manjaro + i3, broot seems to fill up all space normally

BlueskyFR avatar Oct 02 '23 09:10 BlueskyFR