Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cd command not working #30

Closed
lion-man44 opened this issue Mar 28, 2017 · 3 comments
Closed

cd command not working #30

lion-man44 opened this issue Mar 28, 2017 · 3 comments

Comments

@lion-man44
Copy link

Hello.

It's a nice tool.

cd command can not be used.

I tried.

$ pwd
/Users/lion

$ pet list
Description: cd command test
Command: cd ~/hoge/foo/bar
------------------------------

$ pet exec
QUERY>
[cd command test] cd ~/hoge/foo/bar # Enter

$ pwd
/Users/lion # Why?

I expected.

$ pwd
/Users/lion/hoge/foo/bar
@knqyf263
Copy link
Owner

Thanks for your issue.
It's in the specifications. That's because pet exec runs on a different shell.

If you want to move directory and execute command, you need to join commands with && or ;.

$ pet new
Command> cd ~/hoge/foo/bar && ls -al
Description> cd command test
$ pet exec

Otherwise, you can select snippets and display them on the shell.
Please see below for details.
https://github.com/knqyf263/pet#select-snippets-at-the-current-line-like-c-r

# Ctrl+s and select snippets
$ cd ~/hoge/foo/bar # Enter
$ pwd
/Users/lion/hoge/foo/bar

@lion-man44
Copy link
Author

I see!
Thanks for teaching.

@knqyf263
Copy link
Owner

You're welcome!
Feel free to ask me if you have any question!

@knqyf263 knqyf263 mentioned this issue Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants