Skip to content

prompt.debug does not work in tmux when prompt.select is in the code #116

@DannyBen

Description

@DannyBen

Describe the problem

When using prompt.debug in a terminal with tmux panels stacked one on top of the other, the debug message is not displayed when using prompt.select anywhere in the code - probably due to some screen height calculation issues. Without prompt.select in the code, the debug message is shown properly.

Steps to reproduce the problem

  1. Install tmux (sudo apt-get install tmux)
  2. Start tmux: $ tmux
  3. Split the screen to two horizontal panels: Press Ctrl+b+"
  4. Run the below code:
require 'tty-prompt'

prompt = TTY::Prompt.new

prompt.debug "Hello"

# Does NOT show debug message in tmux panel
prompt.select "Can we see it?", [:yes, :no]

# DOES show debug message in tmux panel
# Comment the select above and uncomment this one
# prompt.ask "Can we see it?"

Actual behaviour

Debug message is not shown at the top right corner unless removing the prompt.select line.

Expected behaviour

Expecting to see debug message on the top right corner even when inside tmux panel.

Describe your environment

  • OS version: Ubuntu 18.04.3 LTS
  • Ruby version: ruby 2.6.3p62
  • TTY version:
    • tty-color (0.5.0)
    • tty-cursor (0.7.0)
    • tty-prompt (0.19.0)
    • tty-reader (0.6.0)
    • tty-screen (0.7.0)
    • tty-table (0.11.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions