mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Clear status message on enableProgressBar(false)
Motivated by `meteor shell` in Emacs shell-mode
This commit is contained in:
@@ -261,13 +261,7 @@ _.extend(Console.prototype, {
|
||||
}
|
||||
}
|
||||
|
||||
// For the non-progress-bar status mode, we may need to
|
||||
// clear some characters that we printed with a trailing `\r`.
|
||||
if (self._wroteStatusMessage) {
|
||||
var spaces = new Array(TEMP_STATUS_LENGTH + 1).join(' ');
|
||||
self._stream.write(spaces + '\r');
|
||||
self._wroteStatusMessage = false;
|
||||
}
|
||||
self._clearStatusMessage();
|
||||
|
||||
if (style) {
|
||||
dest.write(style(message + '\n'));
|
||||
@@ -281,6 +275,17 @@ _.extend(Console.prototype, {
|
||||
}
|
||||
},
|
||||
|
||||
_clearStatusMessage: function () {
|
||||
var self = this;
|
||||
// For the non-progress-bar status mode, we may need to
|
||||
// clear some characters that we printed with a trailing `\r`.
|
||||
if (self._wroteStatusMessage) {
|
||||
var spaces = new Array(TEMP_STATUS_LENGTH + 1).join(' ');
|
||||
self._stream.write(spaces + '\r');
|
||||
self._wroteStatusMessage = false;
|
||||
}
|
||||
},
|
||||
|
||||
_format: function (logArguments) {
|
||||
var self = this;
|
||||
|
||||
@@ -318,7 +323,12 @@ _.extend(Console.prototype, {
|
||||
// It's important that we only enter status message mode
|
||||
// if self._pretty, so that we don't start displaying
|
||||
// status messages too soon.
|
||||
self._inStatusMessageMode = true;
|
||||
if (enabled) {
|
||||
self._inStatusMessageMode = true;
|
||||
} else if (self._inStatusMessageMode) {
|
||||
self._clearStatusMessage();
|
||||
self._inStatusMessageMode = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user