@@ -787,6 +787,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
787787 const shellName = (
788788 process . platform === "win32" ? path . win32 . basename ( sh , ".exe" ) : path . basename ( sh )
789789 ) . toLowerCase ( )
790+ const cwd = ctx . directory
790791 const invocations : Record < string , { args : string [ ] } > = {
791792 nu : { args : [ "-c" , input . command ] } ,
792793 fish : { args : [ "-c" , input . command ] } ,
@@ -795,25 +796,27 @@ NOTE: At any point in time through this workflow you should feel free to ask the
795796 "-l" ,
796797 "-c" ,
797798 `
798- __oc_cwd=$PWD
799799 [[ -f ~/.zshenv ]] && source ~/.zshenv >/dev/null 2>&1 || true
800800 [[ -f "\${ZDOTDIR:-$HOME}/.zshrc" ]] && source "\${ZDOTDIR:-$HOME}/.zshrc" >/dev/null 2>&1 || true
801- cd "$__oc_cwd "
801+ cd -- "$1 "
802802 eval ${ JSON . stringify ( input . command ) }
803803 ` ,
804+ "opencode" ,
805+ cwd ,
804806 ] ,
805807 } ,
806808 bash : {
807809 args : [
808810 "-l" ,
809811 "-c" ,
810812 `
811- __oc_cwd=$PWD
812813 shopt -s expand_aliases
813814 [[ -f ~/.bashrc ]] && source ~/.bashrc >/dev/null 2>&1 || true
814- cd "$__oc_cwd "
815+ cd -- "$1 "
815816 eval ${ JSON . stringify ( input . command ) }
816817 ` ,
818+ "opencode" ,
819+ cwd ,
817820 ] ,
818821 } ,
819822 cmd : { args : [ "/c" , input . command ] } ,
@@ -823,7 +826,6 @@ NOTE: At any point in time through this workflow you should feel free to ask the
823826 }
824827
825828 const args = ( invocations [ shellName ] ?? invocations [ "" ] ) . args
826- const cwd = ctx . directory
827829 const shellEnv = yield * plugin . trigger (
828830 "shell.env" ,
829831 { cwd, sessionID : input . sessionID , callID : part . callID } ,
0 commit comments