How to use "tail -f" in Vim's 8.1 :terminal command window?

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

How to use "tail -f" in Vim's 8.1 :terminal command window?

Igor Forca
Hi,
I installed Vim 8.1 on Ubuntu 16.04 using PPA.

1. Now I am editing myfile.txt file in vim.
2. I opened new terminal windows inside vim
with command: :terminal

3. New terminal opens. I typed in:
tail -f myfile.txt
4. I moved back to ordinary Vim window:
Ctrl+w
5. I type in some text and save with :w

PROBLEM: I expect terminal windows refreshes
because of tail -f command, but actually
nothing really happens in :terminal window.

If this is working this would be super-powerful
feature using vim and ssh.

Any idea?

Thanks

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/d42999ee-a94b-46a7-80e4-5f7ccf60c51a%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to use "tail -f" in Vim's 8.1 :terminal command window?

Matteo Landi-2
Did you try the same, tail - f, but from outside vim?

If not wrong, vim is dumping the whole buffer to the file on save (not 'appending' new content) so I wouldn't be surprised it tail - f did not work because of it.

Il sab 23 nov 2019, 16:35 Igor <[hidden email]> ha scritto:
Hi,
I installed Vim 8.1 on Ubuntu 16.04 using PPA.

1. Now I am editing myfile.txt file in vim.
2. I opened new terminal windows inside vim
with command: :terminal

3. New terminal opens. I typed in:
tail -f myfile.txt
4. I moved back to ordinary Vim window:
Ctrl+w
5. I type in some text and save with :w

PROBLEM: I expect terminal windows refreshes
because of tail -f command, but actually
nothing really happens in :terminal window.

If this is working this would be super-powerful
feature using vim and ssh.

Any idea?

Thanks

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/d42999ee-a94b-46a7-80e4-5f7ccf60c51a%40googlegroups.com.

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAKpQHWZKk7n9Y30hidNgtuhk_nd4C8Xyaqzs%2B%3D2ZSq8bHicnYA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to use "tail -f" in Vim's 8.1 :terminal command window?

Brian L. Matthews
On 11/23/19 10:12 AM, Matteo Landi wrote:
 > Did you try the same, tail - f, but from outside vim?
 >
 > If not wrong, vim is dumping the whole buffer to the file on save
(not 'appending' new content) so I wouldn't be surprised it tail - f did
not work because of it.
 >

And I think by default vim renames the current file then writes to a
completely new file, so the file you're tailing never changes, in fact
it gets deleted. You can modify that behavior with various options
(backup, writebackup, backupcopy). I got tail -f to show something by
setting nobackup (which is the default) and nowritebackup (which isn't),
then modifying a file I was tailing. Because of the way tail works, this
would only do something useful if you're just adding lines to the file,
but it does work.

Brian

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/0a0e1b32-e46b-43ba-8730-cbc3a39eeed6%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to use "tail -f" in Vim's 8.1 :terminal command window?

Bram Moolenaar

Brian Matthews wrote:

> On 11/23/19 10:12 AM, Matteo Landi wrote:
>  > Did you try the same, tail - f, but from outside vim?
>  >
>  > If not wrong, vim is dumping the whole buffer to the file on save
> (not 'appending' new content) so I wouldn't be surprised it tail - f did
> not work because of it.
>  >
>
> And I think by default vim renames the current file then writes to a
> completely new file, so the file you're tailing never changes, in fact
> it gets deleted. You can modify that behavior with various options
> (backup, writebackup, backupcopy). I got tail -f to show something by
> setting nobackup (which is the default) and nowritebackup (which isn't),
> then modifying a file I was tailing. Because of the way tail works, this
> would only do something useful if you're just adding lines to the file,
> but it does work.

It works fine for me.  It might indeed depend on the value of
'backupcopy'.

--
Nobody will ever need more than 640 kB RAM.
                -- Bill Gates, 1983
Windows 98 requires 16 MB RAM.
                -- Bill Gates, 1999
Logical conclusion: Nobody will ever need Windows 98.

 /// 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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/201911232058.xANKw3BP020260%40masaka.moolenaar.net.
Reply | Threaded
Open this post in threaded view
|

Re: How to use "tail -f" in Vim's 8.1 :terminal command window?

Gua Chung Lim-2
* Bram Moolenaar <[hidden email]> wrote:
>
> It works fine for me.  It might indeed depend on the value of
> 'backupcopy'.
I also tried 'set bkc=yes' in vimrc, it works. But it is not very responsive. Sometimes, tail -f didn't update the changes. But most of the time it does.

--
Gua Chung Lim
 
"UNIX is basically a simple operating system,
but you have to be a genius to understand the simplicity."
-- Dennis M. Ritchie

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20191124061410.GA114%40gmail.com.