Closed navazjm closed 2 years ago
Thanks @michaelnavs, this is a cool feature! I just tested it and it worked on my Mac. A few thoughts:
Tested on Linux (Ubuntu), worked as expected. It behaves just like MacOS.
Tested it on Windows with WSL Ubuntu and I run into an error on startup.
The error comes from:
pub fn new(settings: &'a Settings, history: &'a History) -> Interface<'a> {
Interface {
history,
settings,
input: CommandInput::from(settings.command.to_owned()),
selection: 0,
matches: Vec::new(),
debug: settings.debug,
run: false,
delete_requests: Vec::new(),
menu_mode: MenuMode::Normal,
in_vim_insert_mode: true,
clipboard_context: ClipboardProvider::new().unwrap(), // error here
}
}
Did that happen on boot, or only when you tried to copy?
It happens on boot
I think we need to defer calling ClipboardProvider::new().unwrap()
until the user actually tries to copy, that way the crash is limited to that UI interaction.
Closes #226
As discussed in issue 226, I installed the rust-clipboard crate to easily add text to the system clipboard. I updated the menu interface text to display the new keybinding for the user to know which keys to press to copy the selected command. I decided to use 'Ctrl+y' in both emacs and vim keybindings. I could not use the default keybindings from either one, so I decided it would be best to use the same keybinding for both. Also, I decided that the user should be able to use the keybinding in both insert and command mode of vim.
Love to hear your feedback @cantino 🤘🏼