You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be nice having our own pwd command. At the moment, doing pwd we get the expected behavior but if we enter a file, since the filesystem view becomes an abstraction and we use the current path to keep track where in the file we currently are, doing pwd will fail.
Reproducing:
> curl https://api.github.com/orgs/nushell | from-json | embed details
━━━━━━━━━━━━━━━━
details
────────────────
[table: 1 row]
━━━━━━━━━━━━━━━━
> curl https://api.github.com/orgs/nushell | from-json | embed details | save data.json
> enter data.json
/> ls
━━━━━━━━━━━━━━━━
details
────────────────
[table: 1 row]
━━━━━━━━━━━━━━━━
/> cd details
/details> ls | pick public_members_url
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
public_members_url
─────────────────────────────────────────────────────────────
https://api.github.com/orgs/nushell/public_members{/member}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
/details> pwd
error: No such file or directory (os error 2)
I was looking into this a little and thought that the pwd command would use the shell manager to get the current path for the current shell. If you are inside of a file (e.g. json or toml) it would know the correct path, while env::current_path would not. Am I on the right track with my understanding on how nushell works?
@JonnyWalker81 You are on the right track señor. We still need to extend it to ValueShell. If you are interested, ideally pwd should be implemented in the shells like for example cd is.
Activity
sophiajt commentedon Sep 7, 2019
When can extend #612 to work with value shell also. We may want to create a new command in Shell for it. cc @wycats
JonnyWalker81 commentedon Sep 7, 2019
I was looking into this a little and thought that the
pwdcommand would use the shell manager to get the current path for the current shell. If you are inside of a file (e.g. json or toml) it would know the correct path, whileenv::current_pathwould not. Am I on the right track with my understanding on how nushell works?andrasio commentedon Sep 7, 2019
@JonnyWalker81 You are on the right track señor. We still need to extend it to ValueShell. If you are interested, ideally
pwdshould be implemented in the shells like for examplecdis.JonnyWalker81 commentedon Sep 7, 2019
I will take a look, seems straightforward enough, but I am probably missing something. @androbtech Thank you for the hint and guidance.
andrasio commentedon Sep 7, 2019
@JonnyWalker81 Full steam ahead, Capitán!
@chhetripradeep @JonnyWalker81 More than welcome to see you guys join the Discord (link in the README)
def argument check (nushell#604)
def argument check (#604)
Cookbook : SSH passphase management (nushell#604)