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

WSL/Debian - Weather - Location Unavailable #271

Closed
Erich-Chen opened this issue Jun 21, 2024 · 5 comments
Closed

WSL/Debian - Weather - Location Unavailable #271

Erich-Chen opened this issue Jun 21, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@Erich-Chen
Copy link

Describe the bug

The weather module displays "Location Unavailable" on WSL/Debian platform.

Cause

ping does not work on WSL/Debian. Thus ping -q -c 1 -W 1 ipinfo.io fails.

Seeing Line 66 - 70 in https://github.com/dracula/tmux/blob/master/scripts/weather.sh, "Location Unavailable" displays.

Resolution

Referring to Issue #5109 for WSL, a workaround can be:

$ sudo setcap cap_net_raw+p /bin/ping

System

  • OS: Debian 12 on WSL (Windows Subsystem Linux)
  • Tmux Version: 3.3a
@Erich-Chen Erich-Chen added the bug Something isn't working label Jun 21, 2024
@ethancedwards8
Copy link
Member

Check now? We reworked the plugin a little bit to use a builtin TCP connection.

@guimochila
Copy link
Contributor

guimochila commented Sep 8, 2024

@ethancedwards8 timeout command is not available on OSX bash version by default. To make it work locally I had to create a timeout command in the weather.sh file:

timeout() {
    perl -e 'alarm shift; exec @ARGV' "$duration" "$@"
}

I'd have to install coreutils package to have access to the timeout command but this is already adding dependency to a bash script.

@ethancedwards8
Copy link
Member

@ethancedwards8 timeout command is not available on OSX bash version by default. To make it work locally I had to create a timeout command in the weather.sh file:

timeout() {
    perl -e 'alarm shift; exec @ARGV' "$duration" "$@"
}

I'd have to install coreutils package to have access to the timeout command but this is already adding dependency to a bash script.

I had not considered that. If you would like to submit a PR to fix that, I will accept it.

@guimochila
Copy link
Contributor

@ethancedwards8 sure! I can open a PR to fix it. xD

@guimochila
Copy link
Contributor

@ethancedwards8 PR is open: #288

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants