@@ -172,6 +172,9 @@ function InterfaceConstructor(input, output, completer, terminal) {
172172 let crlfDelay ;
173173 let prompt = '> ' ;
174174 let signal ;
175+ let historySize ;
176+ let history ;
177+ let removeHistoryDuplicates ;
175178
176179 if ( input ?. input ) {
177180 // An options object was given
@@ -181,9 +184,9 @@ function InterfaceConstructor(input, output, completer, terminal) {
181184 signal = input . signal ;
182185
183186 // It is possible to configure the history through the input object
184- const historySize = input . historySize ;
185- const history = input . history ;
186- const removeHistoryDuplicates = input . removeHistoryDuplicates ;
187+ historySize = input . historySize ;
188+ history = input . history ;
189+ removeHistoryDuplicates = input . removeHistoryDuplicates ;
187190
188191 if ( input . tabSize !== undefined ) {
189192 validateUint32 ( input . tabSize , 'tabSize' , true ) ;
@@ -215,8 +218,6 @@ function InterfaceConstructor(input, output, completer, terminal) {
215218 input . removeHistoryDuplicates = removeHistoryDuplicates ;
216219 }
217220
218- this . setupHistoryManager ( input ) ;
219-
220221 if ( completer !== undefined && typeof completer !== 'function' ) {
221222 throw new ERR_INVALID_ARG_VALUE ( 'completer' , completer ) ;
222223 }
@@ -234,6 +235,7 @@ function InterfaceConstructor(input, output, completer, terminal) {
234235 this [ kSubstringSearch ] = null ;
235236 this . output = output ;
236237 this . input = input ;
238+ this . setupHistoryManager ( input ) ;
237239 this [ kUndoStack ] = [ ] ;
238240 this [ kRedoStack ] = [ ] ;
239241 this [ kPreviousCursorCols ] = - 1 ;
0 commit comments