Comments (2)
This is the (nonworking) workaround I tried:
prompt := promptui.Prompt{
Label: titleType + " " + acctInfo.Username + " password or token: ",
Mask: '*',
}
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
go func() {
sig := <-sigs
fmt.Println()
fmt.Println(sig)
}()
userInput, err := prompt.Run()
if err != nil {
fmt.Println("signal interrupt detected")
os.Exit(1)
}
close(sigs)
Maybe that could help get you started
from promptui.
Ok, sorry, I was just being stupid and wasn't changing the code that was running.
Signal interrupts work fine.
from promptui.
Related Issues (20)
- Using arrays or other data structures
- repeat help string when Detail string is too long HOT 2
- Prompt select label and help appear multiple times HOT 1
- Reset the prompt after selection
- Nohup running retruns ^D
- Auto Complete? HOT 1
- How to remove ":" on label Select? HOT 1
- Prompt Validation: regex matching causes multiple rerenders on input HOT 3
- Git Bash Prompts fail with EOF HOT 1
- Empty lines in output?
- Data race after running promptui.Prompt.Run()
- Stdout should be `io.Writer` instead of `io.WriterCloser`
- Default searcher implemetation HOT 5
- Dynamic search based select HOT 1
- Replace input text while typing
- Run validation after return key
- Disabling the checkmark and output. HOT 1
- https://www.manifold.co certificate is expired since 2022-08-26 HOT 2
- Select HOT 1
- Printf before prompt run will cut long string
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from promptui.