Styling, abbreviated commands
This commit is contained in:
@ -35,7 +35,9 @@ class Shell implements WritableStreamInterface, EventEmitterInterface
|
||||
|
||||
private int $promptWidth = 0;
|
||||
|
||||
private string $promptStyle = "35;1";
|
||||
private string $promptStyle = "36;1";
|
||||
|
||||
private string $inputStyle = "36";
|
||||
|
||||
public function __construct(?ReadableStreamInterface $input=null, ?WritableStreamInterface $output=null)
|
||||
{
|
||||
@ -191,8 +193,8 @@ class Shell implements WritableStreamInterface, EventEmitterInterface
|
||||
$obuf = "\r" . "\e[{$this->promptStyle}m" . $this->prompt . "\e[0m";
|
||||
$ostr = mb_substr($this->buffer, $this->scrollOffset) . " ";
|
||||
$ostr = mb_substr($ostr, 0, $this->termWidth - $this->promptWidth);
|
||||
$obuf .= $ostr . "\e[K\e[" . $pos . "G";
|
||||
$obuf .= "\e[{$this->inputStyle}m" . $ostr . "\e[K\e[0m\e[" . $pos . "G";
|
||||
|
||||
$this->ostream->write($obuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user