fish - easily replace a command before executing it

Specifically, I'm trying to change a command such that the input in the prompt stays the same, the command in the history stays the same, basically that fish looks exactly like I just executed the command, while executing a different command derived from the command I inputted.

In my particular case, I'm trying to put grc before any command, Except for sudo, which in that case, I want to put it after sudo, but before the command.

I have code that sorta works, but it's hacky, doesn't support multiple commands, and overall is just not that good.

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论