Prompt can now be set before linereader is created

This commit is contained in:
noccy committed 2016-11-12 16:37:51 +01:00
1 parent b2a23f992d
commit 482d8a54e5
2 files changed
+9 -6

No files matched your search

+2 -2
View File
@@ -68,11 +68,11 @@ class LineRead
$this->posCursor = strlen($this->buffer);
}
$cursor = strlen($this->prompt) + 1 + $this->posCursor - $this->posScroll;
$cursor = strlen($this->prompt) + 2 + $this->posCursor - $this->posScroll;
$endStyle = "\e[0m";
fprintf(STDOUT, "\r\e[2K%s%s\e[%dG{$endStyle}", ($this->promptStyle)($prompt), ($this->commandStyle)($buffer), $cursor);
fprintf(STDOUT, "\r\e[2K%s %s\e[%dG{$endStyle}", ($this->promptStyle)($prompt), ($this->commandStyle)($buffer), $cursor);
}
protected function styleToAnsi($style)