Hyper: Hyper breaks laravel valet share

Created on 19 Aug 2019  Â·  17Comments  Â·  Source: vercel/hyper

  • [x] I am on the latest Hyper.app version
  • [x] I have searched the issues of this repo and believe that this is not a duplicate

Issue

When trying to use Laravel’s valet share command in Hyper it throws the following error:

ERROR:  Tunnel 'command_line' specifies an invalid or malformed address 'XXXXX:80': strange hostname

The command works fine in the native macOS Terminal and other terminal apps.
More info about the issue/error can be found here: https://github.com/laravel/valet/issues/790#issuecomment-522358081

❌ Is Invalid

Most helpful comment

@LabhanshAgrawal

  1. Install Laravel valet as per the instructions of the docs: https://laravel.com/docs/8.x/valet
  2. Download or clone a php project, for example Kirby’s starterkit: https://github.com/getkirby/starterkit
  3. Open hyper and cd into the php project
  4. Type valet share into hyper to reproduce the error.

Doing the same with the nativ MacOS Terminal will create the desired result.

All 17 comments

same

Same issue for me on a fresh macOS 10.14.x installation.

I also have another macOS device where Hyper and Valet runs since like a year fine and where the bug doesn’t exist.

Still the case for me

@marijnbent can you try the latest ci build https://github.com/vercel/hyper/actions/runs/378801823
and see if it's still happening

Downloaded and tried it, but I get the same error as @kms-rscholz

Same error for me, too.

Same issue here!

Does anyone have a solution?

I've never used laravel, can anyone share some quick setup or example which I can use to test and debug this.

@LabhanshAgrawal

  1. Install Laravel valet as per the instructions of the docs: https://laravel.com/docs/8.x/valet
  2. Download or clone a php project, for example Kirby’s starterkit: https://github.com/getkirby/starterkit
  3. Open hyper and cd into the php project
  4. Type valet share into hyper to reproduce the error.

Doing the same with the nativ MacOS Terminal will create the desired result.

@kms-rscholz thanks for the guide
I'm able to reproduce this
The error seems to be because of ansi color codes see cpriego/valet-linux#221
In Hyper
Screenshot 2021-01-22 at 10 08 10
In Terminal
Screenshot 2021-01-22 at 10 10 54

I tried again after replacing $TLD with test in ~/.composer/vendor/laravel/valet/valet and it started working.

I'm not sure why it's returning normal output in terminal and colored in hyper.

I've also compared environment variables to see if we're setting something which is causing this.

It gives normal output in Terminus and VS Code terminal.

This behavior also seems to sort of propagate down, if I run it in xterm.js demo started from hyper it gives colored output, and if started from terminal it gives normal output

@Tyriar can you please help us out a bit here, if we might be doing something wrong while using node-pty to start the shell or something else.

I don't have any other clue to push ahead. (Should've studied a bit on unix :sigh: :P)

@kms-rscholz @reppair
can you try once after running unset TERM_PROGRAM and check

Might be related to TERM? It's probably an issue of differing environments between Terminal and Hyper.

@kms-rscholz @reppair
can you try once after running unset TERM_PROGRAM and check

This fixes it for me

Well, I've found the reason in an unexpected eureka moment, there's a library 'symfony' being used which is using the TERM_PROGRAM env var and if it detects Hyper it shows colored output, it's some sort of feature for when it's running on windows, based on the fact that windows console didn't use to be able to show ANSI colors, it detects if it's running on hyper and returns colored values as hyper can show them. It seems to use the colored version always on linux.

It should be handled in valet like it was done in valet-linux see
or maybe in symfony to stop using such detection as conhost also supports color now.

@Tyriar I'd checked TERM it was same (xterm-256color) everywhere, btw thanks for taking a look

Phew, For once I thought we're doing something really wrong enough to get different output from commands.

For the time being people can use unset TERM_PROGRAM or export TERM_PROGRAM=<something else> before using valet share, or set it in .bashrc etc

Fixed in valet v2.13.19 (release)

can you try once after running unset TERM_PROGRAM and check

Well I am now running Debian based OS called PopOS v20.10 (no longer I use the MacBook) I also have Laravel valet (it's linux version - Valet Linux) and just downloaded and installed Hyper.deb (v3.0.2) - to my surprise the valet share command works just fine with this setup without running the above mentioned command, after running it it still works! :)

Yeah, they had fixed the issue in their fork, I guess it was also there for other linux terminals.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

legomushroom picture legomushroom  Â·  3Comments

yvan-sraka picture yvan-sraka  Â·  3Comments

leo picture leo  Â·  3Comments

ConstantinChirila picture ConstantinChirila  Â·  3Comments

rauchg picture rauchg  Â·  3Comments