-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Change keyboard type when asking for a password #70
Comments
This can be implemented with an environment variable? This way any shell script can change the keyboard type before asking for something. Variable can be defined as Anyway, detection on passwords still need to be detected... |
@vaites What should be the use of this? If you enter a password, every (good) console application does not echo the password. |
The keyboard changes if you are in a text field or a password field. The most important is the prediction engine (I don't want my passwords to be in my suggestion list) and the keys are different (number keys, comma, etc...). |
But in Termux, the prediction engine doesn't run anyway, unless you use the Text Input View. |
I know, but the keyboard type changes, and depending on your keyboard app is customizable... |
It is nearly impossible to detect where program prompts a password. Reason - it is same stdin, the only difference here is password usually not echoed. Should be possible to track "no echo" terminal state, but most likely will produce false positives in certain cases.
Environment variable useless. Child processes can't modify variables of parent. |
Well, I understand. If there's no reliable method to detect it it's better to do not do it. I asked it because macOS detects it and shows a key. Anyway, it's possible to add an api command with something like this: #!/bin/bash
termux-keyboard-type --password
read -s -p "Password: " password Can this command be added? At least users can change the keyboard type in his scripts by hand... |
I think this issue can be closed, right? Technically it is not possible to check when program needs to switch keyboard or it enables no-echo mode for other reasons. |
I agree that it is not possible to detect when it is necessary to change the keyboard type, but I still find it interesting to be able to change it from a Temux API script. Think of any script that needs a specific input, like a numeric value, a date or an URL. Why not use a global variable set by a Termux API script and set the type of keyboard to use based on that?. Examples: # ask for a date
echo 'date' | termux-keyboard-type-set
read -p "Enter a date: " VARIABLE
termux-keyboard-type-reset
# ask for a number
echo 'number' | termux-keyboard-type-set
read -p "Enter a number: " VARIABLE
termux-keyboard-type-reset
# ask for an URL
echo 'textUri' | termux-keyboard-type-set
read -p "Enter a URL: " VARIABLE
termux-keyboard-type-reset I think (maybe I'm wrong) that setting a global variable for Termux and showing the keyboard based on its value (this values) can't be too complex. Anyway, close the issue if you don't find it useful... |
Termux:API does not handle IME options, they are handled by active application, Termux in that case.
Global variable is relevant for process and the processes it starts, it is not exported to parent processes or processes of other process trees. And it is even not exported to child processes that are already running. Probably that can be done with escape sequences, but that will require to modify all programs that ask for passwords to send this escape sequences. And it is not clear what to do in the case if program crashes and how to reset keyboard type in that case.
Let's wait for @agnostic-apollo |
OK, maybe is too compex. I don't know how Termux works behind the scenes. This may not be worth the effort... Thanks anyway, Termux is great 😉 |
Here escape sequences can be easily added. Need to detect and recompile all dependent packages after. Packages that do not use That's understandable that users want better integration of command line with Android user interface but not everyone here understands that Termux itself is nothing more than just a display interpreting output of command line tools. While accomplishing this task is feasible, that would be a road to overcomplicating things IMO. Changing keyboard by
Nothing, just like any other program that changes terminal configuration. User than can revert back configuration by using utility |
It makes no sense if any package must be patched/rebuilt. Forget it if is so complicated.... |
Intent way would be simpler and should be doable, but probably should wait till after next version work is done on creating command line apis inside termux app itself, |
When any app or script asks for a password the keyboard doesn't change, but in Android the password fields uses an input method type. Is possible to detect this behavior and change keyboard type?
The text was updated successfully, but these errors were encountered: