@@ -144,7 +144,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) {
144144 let escaped = null ;
145145
146146 function getPreviewPos ( ) {
147- const displayPos = repl . _getDisplayPos ( `${ repl . _prompt } ${ repl . line } ` ) ;
147+ const displayPos = repl . _getDisplayPos ( `${ repl . getPrompt ( ) } ${ repl . line } ` ) ;
148148 const cursorPos = repl . line . length !== repl . cursor ?
149149 repl . getCursorPos ( ) :
150150 displayPos ;
@@ -177,7 +177,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) {
177177 rows = pos . displayPos . rows - pos . cursorPos . rows ;
178178 moveCursor ( repl . output , 0 , rows ) ;
179179 }
180- const totalLine = `${ repl . _prompt } ${ repl . line } ${ completionPreview } ` ;
180+ const totalLine = `${ repl . getPrompt ( ) } ${ repl . line } ${ completionPreview } ` ;
181181 const newPos = repl . _getDisplayPos ( totalLine ) ;
182182 // Minimize work for the terminal. It is enough to clear the right part of
183183 // the current line in case the preview is visible on a single line.
@@ -263,7 +263,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) {
263263 }
264264 repl . output . write ( result ) ;
265265 cursorTo ( repl . output , cursorPos . cols ) ;
266- const totalLine = `${ repl . _prompt } ${ repl . line } ${ suffix } ` ;
266+ const totalLine = `${ repl . getPrompt ( ) } ${ repl . line } ${ suffix } ` ;
267267 const newPos = repl . _getDisplayPos ( totalLine ) ;
268268 const rows = newPos . rows - cursorPos . rows - ( newPos . cols === 0 ? 1 : 0 ) ;
269269 moveCursor ( repl . output , 0 , - rows ) ;
@@ -611,7 +611,7 @@ function setupReverseSearch(repl) {
611611 let rows = 0 ;
612612 if ( lastMatch !== - 1 ) {
613613 const line = repl . history [ lastMatch ] . slice ( 0 , lastCursor ) ;
614- rows = repl . _getDisplayPos ( `${ repl . _prompt } ${ line } ` ) . rows ;
614+ rows = repl . _getDisplayPos ( `${ repl . getPrompt ( ) } ${ line } ` ) . rows ;
615615 cursorTo ( repl . output , promptPos . cols ) ;
616616 } else if ( isInReverseSearch && repl . line !== '' ) {
617617 rows = repl . getCursorPos ( ) . rows ;
@@ -631,7 +631,7 @@ function setupReverseSearch(repl) {
631631
632632 // To know exactly how many rows we have to move the cursor back we need the
633633 // cursor rows, the output rows and the input rows.
634- const prompt = repl . _prompt ;
634+ const prompt = repl . getPrompt ( ) ;
635635 const cursorLine = `${ prompt } ${ outputLine . slice ( 0 , cursor ) } ` ;
636636 const cursorPos = repl . _getDisplayPos ( cursorLine ) ;
637637 const outputPos = repl . _getDisplayPos ( `${ prompt } ${ outputLine } ` ) ;
@@ -682,7 +682,7 @@ function setupReverseSearch(repl) {
682682 if ( ! isInReverseSearch ) {
683683 if ( key . ctrl && checkAndSetDirectionKey ( key . name ) ) {
684684 historyIndex = repl . historyIndex ;
685- promptPos = repl . _getDisplayPos ( `${ repl . _prompt } ` ) ;
685+ promptPos = repl . _getDisplayPos ( `${ repl . getPrompt ( ) } ` ) ;
686686 print ( repl . line , `${ labels [ dir ] } _` ) ;
687687 isInReverseSearch = true ;
688688 }
0 commit comments