Rofi: [BUG] rofi/i3 freezes when attempting to launch terminal from a custom mode

Created on 27 Mar 2020  路  3Comments  路  Source: davatorium/rofi

Overview

Rofi (and i3) freeze when attempting to launch a termite instance from a custom mode. The terminal instance successfully launches, however, the rofi dialog never closes and keyboard input stops working entirely until the rofi instance is killed in another tty.

Apologies if this has already been answered -- I did go through as many relevant existing issues relating to rofi freezing/hanging, and also issues related to termite, zsh, etc., but was not able to find any that seemed to fit the problem I'm having.

Version

Version: 1.5.4-73-g1e4409c6 (makepkg)

Configuration

Launch Command

rofi -show notes -modi notes:rofi-notes.sh

rofi-notes.sh (simplified)

#!/bin/zsh
NOTES_DIR="/path/to/notes"

if [ -z $@ ]; then
    fd -t f md $NOTES_DIR
else
    target=`fd -t f md $NOTES_DIR | grep --color='none' "$@"`

    if [ -f "$target" ]; then
        termite -e "nvim $target" > /dev/null
    fi
fi

Steps to reproduce

  • save rofi-notes.sh script above to a file
  • launch rofi, using the script as a custom mode, e.g. rofi -show notes -modi notes:rofi-notes.sh
  • select a file and press

What behaviour you see

The fd command works as expected, and the correct file is opened in a new termite/nvim instance, but then everything freezes.

Can move the mouse, but keyboard and mouse input no longer work until rofi is killed.

What behaviour you expect to see

Neovim launched in a new termite instance, opening the selected file.

Additional details:

  • i3 version: 4.16.1-184-g00181678 (2019-07-03, branch "makepkg")
  • termite version: v15

Other things tested:

  • Tried bash instead of ZSH
  • Tried xterm instead of termite
  • Tried adding an "exit 0" after the nvim command
  • Tried vim instead of neovim
  • Tried pointing to a static file instead of using fd

Please do not submit reports related to wayland, see
here for more
information.

bug

Most helpful comment

Thanks! Indeed, this did the trick:

coproc termite -e "nvim $target" > /dev/null

I Appreciate the quick help. Stay safe!

All 3 comments

Don't launch the terminal blocking, rofi will keep waiting for output from the script (to display)..

Duplicate of: #1063, #864 and info in #857

Thanks! Indeed, this did the trick:

coproc termite -e "nvim $target" > /dev/null

I Appreciate the quick help. Stay safe!

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

orschiro picture orschiro  路  5Comments

vktec picture vktec  路  4Comments

pigmonkey picture pigmonkey  路  5Comments

strogiyotec picture strogiyotec  路  4Comments

DragonAxe picture DragonAxe  路  3Comments