Skip to content
\n

and

\n
{ on = [ \"g\", \"l\" ], run = \"cd $(readlink '@0')\", desc = \"Go to the symlink original directory\" },
\n

But nothing works.

\n

Am I doing something wrong? Thanks!

\n
\n

UPDATE:
\nI have changed the approach and tried creating a plugin. Here is the init.lua:

\n
return {\n    entry = function()\n        local h = cx.active.current.hovered\n        local original_url = h.link_to\n        if h and original_url then\n            ya.manager_emit(\"reveal\", { path = original_url })\n        end\n    end,\n}
\n

This cds into the symlink's parent directory, not the original path. Why is the original path not being passed into the pathargument?

","upvoteCount":2,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

Change the plugin to this, then it works:

\n
return {\n   entry = function()\n      local h = cx.active.current.hovered\n      local original_url = h.link_to\n      if h and original_url then\n         ya.manager_emit(\"cd\", { original_url })\n      end\n   end,\n}
","upvoteCount":3,"url":"https://github.com/sxyazi/yazi/discussions/1493#discussioncomment-10988310"}}}

Follow a symlink #1493

Closed Locked Answered by lkschu
PedroDSFerreira asked this question in 1. Q&A
Discussion options

You must be logged in to vote

Change the plugin to this, then it works:

return {
   entry = function()
      local h = cx.active.current.hovered
      local original_url = h.link_to
      if h and original_url then
         ya.manager_emit("cd", { original_url })
      end
   end,
}

Replies: 1 comment

Comment options

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