Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Width incorrectly reported inside tmux #11

Open
vbauerster opened this issue Jan 25, 2017 · 3 comments
Open

Width incorrectly reported inside tmux #11

vbauerster opened this issue Jan 25, 2017 · 3 comments

Comments

@vbauerster
Copy link

Given the code:

package main

import (
	"fmt"
	"time"

	"github.com/buger/goterm"
)

func main() {
	for {
		w := goterm.Width()
		fmt.Printf("\rwidth: %d", w)
		time.Sleep(100 * time.Millisecond)
	}
}

Width reported correctly without tmux:
normalf.gif

Width reported incorrectly inside tmux:
tmux.gif

@vbauerster
Copy link
Author

Any idea how to fix under tmux?

@harmon25
Copy link

harmon25 commented Apr 4, 2017

I added a w32 call that works to retrieve Windows console dimensions - won't help on tmux though...

@c032
Copy link

c032 commented Dec 4, 2017

A veeery crude fix is checking whether the TMUX environment variable is set, and then parse the output of the command tmux display -p '#{pane_width} #{pane_height}'. I bet it can also be done by communicating with its socket, but couldn't find any documentation on that.

I'd like to know how WeeChat handles this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants