Start terminal in a given directory

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Start terminal in a given directory

Lifepillar
Currently, terminal jobs are always started in :pwd, AFAICT.
Is there a reason why the "cwd" option from job_start() is not inherited
by term_start()?

What is the recommended way to start a terminal job in a given
working directory?

Thanks,
Life.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Start terminal in a given directory

Bram Moolenaar

> Currently, terminal jobs are always started in :pwd, AFAICT.
> Is there a reason why the "cwd" option from job_start() is not inherited
> by term_start()?

I though this was in the todo list, but I can't find it now.

> What is the recommended way to start a terminal job in a given
> working directory?

Use a shell script?

--
"Beware of bugs in the above code; I have only proved
it correct, not tried it." -- Donald Knuth

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Start terminal in a given directory

Lifepillar
On 22/08/2018 21:06, Bram Moolenaar wrote:
>
>> Currently, terminal jobs are always started in :pwd, AFAICT.
>> Is there a reason why the "cwd" option from job_start() is not inherited
>> by term_start()?
>
> I though this was in the todo list, but I can't find it now.

Ah, it's implemented already and documented under :h term_start()!

This works just fine:

     :call term_start("ls", {"cwd": "/usr/local"})

Sorry for the noise: a consequence of an unfortunate combination of
(1) trying to use a wrong syntax, and (2) making a typo when searching
the help.

Life.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Start terminal in a given directory

Jason Franklin
The documentation under term_start() was recently updated
to include this option.  See my message below.

https://groups.google.com/forum/#!topic/vim_dev/WAFS5NrSrB4

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Start terminal in a given directory

Lifepillar
On 23/08/2018 15:28, Jason Franklin wrote:
> The documentation under term_start() was recently updated
> to include this option.

So, I have likely searched the help in a version without your patch,
which, has led me to believe that "cwd" was not supported.

Thanks for letting me know!
Life.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Start terminal in a given directory

Ken Takata-2
Hi,

2018/8/24 Fri 1:19:18 UTC+9 Lifepillar wrote:
> On 23/08/2018 15:28, Jason Franklin wrote:
> > The documentation under term_start() was recently updated
> > to include this option.
>
> So, I have likely searched the help in a version without your patch,
> which, has led me to believe that "cwd" was not supported.
>
> Thanks for letting me know!
> Life.

The "cwd" option was supported by Vim 8.0.0902.
If you use older than that version, you may want to try this:

  new | lcd /path/to/dir | terminal ++curwin

Regards,
Ken Takata

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.