Use the GUI version of vim (/Applications/MacPorts/MacVim.app). Or use regular 
vi / vim in a different terminal emulator that doesn't behave as you
describe.

AFAIK, if your terminal display is restored after exiting vi, the terminal 
provides (and vi uses, via the smcup and rmcup terminfo strings) an alternate
buffer, for full-screen use.  Ideally, that alternate buffer should NOT include 
any scroll back, so I think the behavior you describe might even be a bug.

Maybe there's a preference that I don't remember that would fix that for 
Terminal.app; or maybe some other escape sequence settings for smcup and
rmcup might fix that.  If there's a really complete list of escape sequences 
for Terminal.app (aside from those of a color xterm, if there are any 
differences),
I don't know where to find it, unfortunately.

> On Jul 4, 2019, at 05:32, Christoph Kukulies <[email protected]> wrote:
> 
> I’m asking it here although the vi in macOS surely isn’t a macport but I’m 
> asking anyway:
> 
> Whenever I copy/paste a file content in vi (started from a Terminal) using 
> CMD-A or select-CMD-C to select all to put it elsewhere into a text receiving 
> object (like Notes) using CMD-V, I’m getting the whole history of that 
> terminal window. Not only the file contents.
> 
> That’s confusing once you forget about that fact. You paste the contents, 
> e.g. a certificate, into a webbrowser and later you are wondering about all 
> that stuff in thet text widget which you didn’t intend to get there.
> 
> I understand why it might be correct that CMD-A copies the whole terminal 
> window contents, not only the vi-part, but it’s weird anyway.
> 
> Is the a way to circumvent this problem?  
> 
> —
> Christoph
> 
> 

Reply via email to