mirror of
https://github.com/nushell/nushell
synced 2024-12-27 05:23:11 +00:00
fixes ansi escape leakage from ill-behaved externals, again! (#6012)
* this fixes ansi escape leakage from ill-behaved externals * cross-platform fix
This commit is contained in:
parent
f3036b8cfd
commit
c1bf9fd897
1 changed files with 7 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
#[cfg(windows)]
|
||||
use nu_utils::enable_vt_processing;
|
||||
use reedline::DefaultPrompt;
|
||||
|
||||
use {
|
||||
reedline::{
|
||||
Prompt, PromptEditMode, PromptHistorySearch, PromptHistorySearchStatus, PromptViMode,
|
||||
|
@ -86,6 +87,11 @@ impl NushellPrompt {
|
|||
|
||||
impl Prompt for NushellPrompt {
|
||||
fn render_prompt_left(&self) -> Cow<str> {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
let _ = enable_vt_processing();
|
||||
}
|
||||
|
||||
if let Some(prompt_string) = &self.left_prompt_string {
|
||||
prompt_string.replace('\n', "\r\n").into()
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue