Skip to content

lua help - add pushd command #480

Closed Answered by chrisant996
eggbean asked this question in Q&A
Discussion options

You must be logged in to vote

Oh, it looks like you're trying to use Lua as though it's a shell scripting language. It is not. pushd is a shell command, not a Lua function.

And __zoxide_query and __zoxide_cd are functions defined in the Lua script, and they return a string. The string is returned to Clink, and Clink returns it to CMD, which executes the string as though the user typed it into the command prompt.

And __zoxide_query calls __zoxide_cd.

So you probably just need to change the __zoxide_cd function to return whatever command line you want to be executed. It sounds like you want to put two commands in the command line, something like " pushd %cd% & " .. preceding whatever normally gets returned.

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by eggbean
Comment options

You must be logged in to vote
1 reply
@chrisant996
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants