zsh: complete relative path as absolute?Add arguments from previous command to zsh completionpath_helper and...

Contour integration with infinite poles

Detail vs. filler

How to identify whether a publisher is genuine or not?

Integrals from Brasilian Math Olympiad 2019

Delete n lines skip 1 line script

Is it possible for a company to grow but its stock price stays the same or decrease?

My machine, client installed VPN,

If a spaceship ran out of fuel somewhere in space between Earth and Mars, does it slowly drift off to the Sun?

Why most footers have a background color has a divider of section?

How to work around players whose backstory goes against the story?

What would happen if I build a half bath without permits?

How to study endgames?

Realistically, how much do you need to start investing?

Would a horse be sufficient buffer to prevent injury when falling from a great height?

How is the Apple Watch ECG disabled in certain countries?

Creating specific options in `Manipulate[]`

How important is knowledge of trig identities for use in Calculus

Are devices supposed to automatically be removed from iCloud when all content and settings are erased?

Science fiction episode about the creation of a living pegasus, even though flightless

Would allowing versatile weapons wielded in two hands to benefit from Dueling be unbalanced?

Earliest time frog can jump to the other side of a river in C#. Codility's task

How to bring home documents from work?

What would influence an alien race to map their planet in a way other than the traditional map of the Earth

Would an object shot from earth fall into the sun?



zsh: complete relative path as absolute?


Add arguments from previous command to zsh completionpath_helper and zshZSH host name completion behaviour change?How to make ZSH tab completion work with two tabszsh completion: getting file names from a specific directoryAbsolute path to currently-running zsh?How can I expand all variables at the command line in Zsh?How can I tab-complete umount, restricting to volumes in a specific directory?Complete a command fully relative to a different directory






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I'm trying to write a completion function for a command that requires that its argument be an absolute path. (No, I don't know why.) I thought it would be nice to allow typing a relative path, but completion would expand it to an absolute path — that way, if I forget the requirement for an absolute path, completion will fix it for me. For example, if my working directory is home and I have a file "foo" and I type fo<TAB>, it would complete to /usr/me/foo instead of just foo like _files would do.



Problem is, I have no idea how to do this. I've been through all the flags on _files and compadd, and nothing sounds relevant. _canonical_paths sounds close, but I can't get it to do anything. Once the argument is an absolute path, _files works just fine; it's that initial step that's the issue. Suggestions?










share|improve this question







New contributor



Chris N is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




























    0















    I'm trying to write a completion function for a command that requires that its argument be an absolute path. (No, I don't know why.) I thought it would be nice to allow typing a relative path, but completion would expand it to an absolute path — that way, if I forget the requirement for an absolute path, completion will fix it for me. For example, if my working directory is home and I have a file "foo" and I type fo<TAB>, it would complete to /usr/me/foo instead of just foo like _files would do.



    Problem is, I have no idea how to do this. I've been through all the flags on _files and compadd, and nothing sounds relevant. _canonical_paths sounds close, but I can't get it to do anything. Once the argument is an absolute path, _files works just fine; it's that initial step that's the issue. Suggestions?










    share|improve this question







    New contributor



    Chris N is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.
























      0












      0








      0








      I'm trying to write a completion function for a command that requires that its argument be an absolute path. (No, I don't know why.) I thought it would be nice to allow typing a relative path, but completion would expand it to an absolute path — that way, if I forget the requirement for an absolute path, completion will fix it for me. For example, if my working directory is home and I have a file "foo" and I type fo<TAB>, it would complete to /usr/me/foo instead of just foo like _files would do.



      Problem is, I have no idea how to do this. I've been through all the flags on _files and compadd, and nothing sounds relevant. _canonical_paths sounds close, but I can't get it to do anything. Once the argument is an absolute path, _files works just fine; it's that initial step that's the issue. Suggestions?










      share|improve this question







      New contributor



      Chris N is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I'm trying to write a completion function for a command that requires that its argument be an absolute path. (No, I don't know why.) I thought it would be nice to allow typing a relative path, but completion would expand it to an absolute path — that way, if I forget the requirement for an absolute path, completion will fix it for me. For example, if my working directory is home and I have a file "foo" and I type fo<TAB>, it would complete to /usr/me/foo instead of just foo like _files would do.



      Problem is, I have no idea how to do this. I've been through all the flags on _files and compadd, and nothing sounds relevant. _canonical_paths sounds close, but I can't get it to do anything. Once the argument is an absolute path, _files works just fine; it's that initial step that's the issue. Suggestions?







      zsh






      share|improve this question







      New contributor



      Chris N is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question







      New contributor



      Chris N is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question






      New contributor



      Chris N is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 52 mins ago









      Chris NChris N

      101




      101




      New contributor



      Chris N is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      Chris N is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.



























          0






          active

          oldest

          votes














          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });







          Chris N is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded
















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f543549%2fzsh-complete-relative-path-as-absolute%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          Chris N is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded

















          Chris N is a new contributor. Be nice, and check out our Code of Conduct.













          Chris N is a new contributor. Be nice, and check out our Code of Conduct.












          Chris N is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f543549%2fzsh-complete-relative-path-as-absolute%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

          The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

          Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...