Closed SamShowalter closed 2 years ago
I see something similar - it shows question marks instead (with bash)
18:43 $ mcfly search
18:43 $ ????????????????
-bash: $'\317\317\317\317\317\317\317\317\317\317\317\317\317\317\317\317': command not found
18:44 $ mcfly --version
McFly 0.5.11
Hi, I'm getting the same with the latest git version (0.5.12); also on an M1 and installed via brew.
Don't really know much about rust or ioctl calls, but for what it is worth I played around with the source code a bit and fake_typer:use_tiocsti does get the correct string, so perhaps the issue is somewhere in the ioctl call? I did try calling ioctl using python on the same computer and there it works
In [2]: import fcntl
In [3]: import termios
In [4]: import sys
In [5]: for c in "test":
...: fcntl.ioctl(sys.stdin, termios.TIOCSTI, c)
test
In [6]: test
Not sure if this is helpful. Looking forward to getting this bug fixed though ;) Also happy to try things out on my laptop if that helps.
played around a bit more and this seems to work for me: fake_typer.rs
use libc;
extern {
pub fn ioctl(fd: libc::c_int, req: libc::c_ulong, ...) -> libc::c_int;
}
pub fn use_tiocsti(string: &str) {
for byte in string.as_bytes() {
let a: *const u8 = byte;
if unsafe { ioctl(0, libc::TIOCSTI, a) } < 0 {
panic!("Error encountered when calling ioctl");
}
}
}
Note: first time rust user, so I really have no idea what I'm doing here ;)
Hey @arunpersaud, awesome! That seems to still work fine for me on my non-M1 Mac. Does that mean that https://github.com/cantino/mcfly/pull/228 fixes the issue for you @arunpersaud and @SamShowalter and @rm-hull?
Just tried out the fix-tiocsti-cast-bug branch (69fd1f2c606) and that seems to work on my computer. Thanks!
Looks good to me!
Thanks! I'll get a new release out shortly.
Released in v0.5.13.
v0.5.13 works for me now on M1 with bash Thank you
M1 Mac: 12.1 (Monterey) iTerm: 3.4.15 zsh: 5.8 mcfly version: 0.5.11 zsh plugins: {zsh} | -z, -autosuggestions, autojump, git, vi-mode other plugins: tldr
When I run
mcfly search {keyword}
the history bar pops up like normal. However, any attempt to complete something from this menu results in a strange "illegal byte sequence" error. Thezvm_update_repeat_commands
error is the result ofvi-mode
choking on the byte sequences (but removing that plugin does not resolve the issue). I have removed all plugins and witnessed the same behavior.Please see the two screenshots I have added below.
After hitting
Enter
orTab