Skip to content

Commit eb1d854

Browse files
authored
Merge pull request #10 from sammhansen/develop
fix(wtype): simulate an actual keypress instead of sending literal \t \n chars
2 parents 34e4610 + e62c7e7 commit eb1d854

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ frbw
44
*/fuzzel-rbw*
55
*.tar*
66
/aur
7+
/pin-fuzzel

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "fuzzel-rbw"
3-
version = "0.1.2"
3+
version = "0.1.3"
44
edition = "2024"
55

66
[dependencies]

src/utils/wtype.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
use std::{io::Error, process::Command};
22

3-
// uses wtype to type in the user and pass
3+
// keys in a sequence of the username,tab,password then return
4+
// this fixes some incognito tabs failing to work because \t and \n are actual simulated keypresses
45
pub fn key_in(user: String, pass: String) -> Result<(), Error> {
5-
let args = format!("{}\t{}", user.trim(), pass.trim());
6-
Command::new("wtype").arg(args).output()?;
6+
Command::new("wtype").arg(user.trim()).status()?;
7+
Command::new("wtype").args(["-k", "Tab"]).status()?;
8+
Command::new("wtype").arg(pass.trim()).status()?;
9+
Command::new("wtype").args(["-k", "Return"]).status()?;
710
Ok(())
811
}

0 commit comments

Comments
 (0)