hoaproject / Console

The Hoa\Console library.
https://hoa-project.net/
366 stars 32 forks source link

Ensure that \n is well-interpreted by the shell #23

Closed Hywan closed 10 years ago

Hywan commented 10 years ago

Should #21.

Hywan commented 10 years ago

/ping @Nasga I can't test on every platform. I would like all the @hoaproject/hoackers to test this patch and observe any warnings please :-)

CircleCode commented 10 years ago

I don't remember where, but I've seen several platforms where echo -e is not well supported

Metalaka commented 10 years ago

For my test under Linux I use Wheezy 3.2.0 / Debian 7.5 + PHP 5.4.4 through VirtualBox. The output is correct without this commit for me;)

But I've got tput: unknown terminfo capability '-e' before the result with PuTTY (returned by line 206). And with the VirtualBox console I have this: (returned by line 201).

tput: unknown terminfo capability '-e'
array(2) {
  ["x"]=>
  int(0)
  ["y"]=>
  int(0)
}

Edit: From CLI, I must type $ echo -e "cols\nlines" | tput -S.

Hywan commented 10 years ago

What about now?

SebastienElet commented 10 years ago

It's ok for me on bash/zsh

Metalaka commented 10 years ago

Good for me.

Hywan commented 10 years ago

Thanks everyone. No more echo now. Will work everywhere since tput is standard.