Skip to content
Open
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
8 changes: 7 additions & 1 deletion NAPS2.Lib/Automation/AutomatedScanning.cs
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,13 @@ private async Task PerformScan(ScanProfile profile)
if (_options.WaitScan)
{
OutputVerbose(ConsoleResources.PressEnterToScan);
Console.ReadLine();
var input = Console.ReadLine();
if (input == null)
{
// Ctrl+D (EOF) detected - stop scanning and save
OutputVerbose(ConsoleResources.StoppingScan);
break;
}
}
if (_options.Delay > 0)
{
Expand Down
11 changes: 10 additions & 1 deletion NAPS2.Lib/Lang/ConsoleResources/ConsoleResources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion NAPS2.Lib/Lang/ConsoleResources/ConsoleResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
<value>Waiting {0}ms...</value>
</data>
<data name="PressEnterToScan" xml:space="preserve">
<value>Press Enter to scan.</value>
<value>Press Enter to scan, or Ctrl+D to stop and save.</value>
</data>
<data name="StartingScan" xml:space="preserve">
<value>Starting scan {0} of {1}...</value>
Expand Down Expand Up @@ -269,4 +269,7 @@ Use the "--importpassword" option.</value>
<data name="Cancelling" xml:space="preserve">
<value>Cancelling... Press Ctrl+C again to terminate.</value>
</data>
<data name="StoppingScan" xml:space="preserve">
<value>Stopping scan and saving...</value>
</data>
</root>