File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
reader/src/main/java/org/jline/reader/impl Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -763,12 +763,17 @@ && getLastBinding().charAt(0) == originalAttributes.getControlChar(ControlChar.V
763
763
throw e ;
764
764
}
765
765
} finally {
766
- boolean interrupted = Thread .interrupted ();
766
+ AtomicBoolean interrupted = new AtomicBoolean ( Thread .interrupted () );
767
767
try {
768
768
lock .lock ();
769
769
770
770
this .reading = false ;
771
771
772
+ Terminal .SignalHandler tmpHandler = terminal .handle (Signal .INT , s -> interrupted .set (true ));
773
+ if (previousIntrHandler == null ) {
774
+ previousIntrHandler = tmpHandler ;
775
+ }
776
+
772
777
cleanup ();
773
778
if (originalAttributes != null ) {
774
779
terminal .setAttributes (originalAttributes );
@@ -785,7 +790,7 @@ && getLastBinding().charAt(0) == originalAttributes.getControlChar(ControlChar.V
785
790
} finally {
786
791
lock .unlock ();
787
792
startedReading .set (false );
788
- if (interrupted ) {
793
+ if (interrupted . get () ) {
789
794
Thread .currentThread ().interrupt ();
790
795
}
791
796
}
You can’t perform that action at this time.
0 commit comments