Skip to content

Commit

Permalink
[main-] enable cell editing for interactive batch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
midichef committed Dec 17, 2024
1 parent ff489d3 commit 9c34262
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion visidata/_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ def _drawPrompt(val=''):
@VisiData.api
def confirm(vd, prompt, exc=EscapeException):
'Display *prompt* on status line and demand input that starts with "Y" or "y" to proceed. Raise *exc* otherwise. Return True.'
if vd.options.batch and not vd.options.interactive:
if vd.options.batch:
return vd.fail('cannot confirm in batch mode: ' + prompt)

yn = vd.input(prompt, value='no', record=False)[:1]
Expand Down
2 changes: 1 addition & 1 deletion visidata/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def run(self, scr):
@VisiData.api
def confirm(vd, prompt, exc=EscapeException):
'Display *prompt* on status line and demand input that starts with "Y" or "y" to proceed. Raise *exc* otherwise. Return True.'
if vd.options.batch and not vd.options.interactive:
if vd.options.batch:
return vd.fail('cannot confirm in batch mode: ' + prompt)

form = FormSheet('confirm', rows=[
Expand Down
1 change: 1 addition & 0 deletions visidata/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ def main_vd():
return 1

if vd.options.interactive:
vd.options.batch = False #2639
vd.execAsync = lambda *args, vd=vd, **kwargs: visidata.VisiData.execAsync(vd, *args, **kwargs)
run()
else:
Expand Down

0 comments on commit 9c34262

Please sign in to comment.