mirror of
https://github.com/nushell/nushell
synced 2025-01-15 14:44:14 +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::DefaultPrompt;
|
||||||
|
|
||||||
use {
|
use {
|
||||||
reedline::{
|
reedline::{
|
||||||
Prompt, PromptEditMode, PromptHistorySearch, PromptHistorySearchStatus, PromptViMode,
|
Prompt, PromptEditMode, PromptHistorySearch, PromptHistorySearchStatus, PromptViMode,
|
||||||
|
@ -86,6 +87,11 @@ impl NushellPrompt {
|
||||||
|
|
||||||
impl Prompt for NushellPrompt {
|
impl Prompt for NushellPrompt {
|
||||||
fn render_prompt_left(&self) -> Cow<str> {
|
fn render_prompt_left(&self) -> Cow<str> {
|
||||||
|
#[cfg(windows)]
|
||||||
|
{
|
||||||
|
let _ = enable_vt_processing();
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(prompt_string) = &self.left_prompt_string {
|
if let Some(prompt_string) = &self.left_prompt_string {
|
||||||
prompt_string.replace('\n', "\r\n").into()
|
prompt_string.replace('\n', "\r\n").into()
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue