fyne-io/terminal

Send Password

Closed this issue · 9 comments

Hello teacher, how to send user password with multiline commands? Simple:

func autoComplete(commands string){
terminal.write string(commands)
terminal.run()
}

func main(){
commands:='
su root
password:123456
pacman -S go
pacman -S clang
'
autoComplete(commands)
}

I don't quite know the context so it's not clear what you are aiming to do.
A terminal sends characters to the program running within it. The program gets the events and decides what to do with them.
So if your application is expecting a password it will not appear.

Your code will need to be more intelligent to execute commands one at a time, send keystrokes once they are responding, then progress with the next one, otherwise all of that text will be dumped to your shell program in one go.

I don't quite know the context so it's not clear what you are aiming to do.
A terminal sends characters to the program running within it. The program gets the events and decides what to do with them.
So if your application is expecting a password it will not appear.

Your code will need to be more intelligent to execute commands one at a time, send keystrokes once they are responding, then progress with the next one, otherwise all of that text will be dumped to your shell program in one go.

Hello,when i install windows and linux system late every time, the first thing i must input more and more repeated commands install application for develop environment, so i aways write a script for do that. I must input $user password on shell app window on linux. And the long time late,more and more scripts will be writes, because their function is different,so i can't merge them. Finally i think the best way is use your terminal pkg do this.

For example:

cd /usr
git clone https://gitee.com/ddkwork/go.git
cd ./go/src
sh ./make.bash
cd /usr
rm -rf /usr/lib/go
mv ./go /usr/lib/go

We can use fyne terminal do this for build go develop branch with once commands send.

I don't quite know the context so it's not clear what you are aiming to do.
A terminal sends characters to the program running within it. The program gets the events and decides what to do with them.
So if your application is expecting a password it will not appear.

Your code will need to be more intelligent to execute commands one at a time, send keystrokes once they are responding, then progress with the next one, otherwise all of that text will be dumped to your shell program in one go.

Hello again for you, if embed terminal to app, the focus aways losted, so please add terminal as a widget to fyne internal widget, another problem is can you add and export a named mainWindow field, it aways used in dialog and focus.

Screenshot_20210713_012124_com realvnc viewer android
Screenshot_20210713_012146_com realvnc viewer android

Hello again for you, if embed terminal to app, the focus aways losted, so please add terminal as a widget to fyne internal widget

I do not understand this. Widgets are not created focused, you need to call Canvas.Focus(myObj) or have the user focus it with Tab key or mouse tap.

another problem is can you add and export a named mainWindow field, it aways used in dialog and focus.

As the application developer you create the window, so you should be able to save a reference for use later.

It sounds like the issue was concluded, closing ticket.

It sounds like the issue was concluded, closing ticket.

Sorry, my test look like is a bug.
Screenshot_20210713_093359_com realvnc viewer android

What is the bug? The title is “send password”

What is the bug? The title is “send password”

Apptab or tree focus when onselected fn test falid.

AppTabs and Tree do not have any focus code, I'm not sure what you mean.