3 ms·
https://github.com/fish-shell/fish-shell/issues/288#issuecomment-11233013 https://github.com/fish-shell/fish-shell/issues/288#issuecom... has some options.
by kbd 14y ago
https://github.com/fish-shell/fish-shell/issues/288#issuecomment-11233013 https://github.com/fish-shell/fish-shell/issues/288#issuecom... has some options.
- pooriaazimi 14y agoWonderful! I made a slight variation (and also posted it there): function .runsudo --description 'Run current command line as root' set cursor_pos (echo (commandline -C) + 5 | bc) commandline -C 0 commandline -i 'sudo ' commandline -C "$cursor_pos" end bind \es ".runsudo" Instead of outright `execute`ing the command, the above would save the cursor position. You can (theoretically) bind `\cs` so control-s adds the sudo (instead of option-s), but I couldn't get it to work.