mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 14:30:10 +01:00
chore: perform bash history in shell
This commit is contained in:
parent
84802c4a9c
commit
6feb88d48f
1 changed files with 2 additions and 5 deletions
|
|
@ -54,10 +54,7 @@ pub fn last_command(shell: &str) -> String {
|
|||
};
|
||||
|
||||
match shell {
|
||||
"bash" => {
|
||||
let first_line = last_command.lines().next().unwrap().trim();
|
||||
first_line.split_once(' ').unwrap().1.to_string()
|
||||
}
|
||||
"bash" => last_command,
|
||||
"zsh" => last_command,
|
||||
"fish" => last_command,
|
||||
"nu" => last_command,
|
||||
|
|
@ -152,7 +149,7 @@ pub fn initialization(shell: &str, binary_path: &str, auto_alias: &str, cnf: boo
|
|||
|
||||
match shell {
|
||||
"bash" => {
|
||||
last_command = "$(history 2)";
|
||||
last_command = r"$(history 2 | head -n 1 | sed 's/^\s*[0-9]*//')";
|
||||
alias = "$(alias)"
|
||||
}
|
||||
"zsh" => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue