Make transform*, --info-command, and execute-silent cancellable

Users can press CTRL-C after 1 second to terminate the command.

Close #3883
This commit is contained in:
Junegunn Choi committed 2024-06-22 17:24:47 +09:00
1 parent db01e7dab6
commit 7c2ffd3fef
4 files changed
+92 -29

No files matched your search

+8 -2
View File
@@ -137,8 +137,11 @@ func TestOnce(t *testing.T) {
if o() {
t.Error("Expected: false")
}
if o() {
t.Error("Expected: false")
if !o() {
t.Error("Expected: true")
}
if !o() {
t.Error("Expected: true")
}
o = Once(true)
@@ -148,6 +151,9 @@ func TestOnce(t *testing.T) {
if o() {
t.Error("Expected: false")
}
if o() {
t.Error("Expected: false")
}
}
func TestRunesWidth(t *testing.T) {