Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[main-] enable cell editing for interactive batch mode #2641

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading