File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -220,7 +220,9 @@ func Interactive(options Options) int { //nolint:funlen // we do have quite a fe
220
220
options .NilAndErr = true
221
221
s := eval .NewState ()
222
222
s .NoReg = options .NoReg
223
- s .MaxDepth = options .MaxDepth
223
+ if options .MaxDepth > 0 {
224
+ s .MaxDepth = options .MaxDepth
225
+ }
224
226
s .MaxValueLen = options .MaxValueLen // 0 is unlimited so ok to copy as is.
225
227
term , err := terminal .Open (context .Background ())
226
228
if err != nil {
@@ -248,7 +250,9 @@ func Interactive(options Options) int { //nolint:funlen // we do have quite a fe
248
250
term .SetAutoHistory (false )
249
251
options .DualFormat = true // because terminal doesn't (yet) do well will multi-line commands.
250
252
term .NewHistory (options .MaxHistory )
251
- _ = term .SetHistoryFile (options .HistoryFile )
253
+ if options .HistoryFile != "" {
254
+ _ = term .SetHistoryFile (options .HistoryFile )
255
+ }
252
256
_ = AutoLoad (s , options ) // errors already logged
253
257
if options .PreInput != nil {
254
258
options .PreInput (s )
You can’t perform that action at this time.
0 commit comments