ChesterYue / ohmyzsh-theme-passion

An oh-my-zsh theme.
MIT License
294 stars 135 forks source link

improve theme shell #11

Closed LronDC closed 1 year ago

LronDC commented 2 years ago

passion.zsh-theme: line#106 local cmd="${$(fc -l | tail -1)#* }"

will return line number, and I think it's should be optimized image

add -n flag to fc command to ignore the line number.

local cmd="${$(fc -ln | tail -1)#* }"

LronDC commented 2 years ago

/cc @ChesterYue

ChesterYue commented 1 year ago

passion.zsh-theme: line#106 local cmd="${$(fc -l | tail -1)#* }"

will return line number, and I think it's should be optimized image

add -n flag to fc command to ignore the line number.

local cmd="${$(fc -ln | tail -1)#* }"

I found fc can -number to get last so just local cmd="$(fc -ln -1)"; 93e68a3eb714e361719e0ffce25c4d2108baf475

LronDC commented 1 year ago

passion.zsh-theme: line#106 local cmd="${$(fc -l | tail -1)#* }" will return line number, and I think it's should be optimized image add -n flag to fc command to ignore the line number. local cmd="${$(fc -ln | tail -1)#* }"

I found fc can -number to get last so just local cmd="$(fc -ln -1)"; 93e68a3

Nice.