-
My work machine is a macOS laptop, and I'm trying out ghostty (v1.0.1) to replace iterm2. I do my development work by connecting to a remote headless linux server with eternal terminal (et). et gives me persistant sessions and I don't need to worry about disconnections when I close my laptop or change offices etc. On that server I run a tmux session per project I'm working on. These preserve my state, so I can switch between projects and keep the open files and shell history etc. Then finally I edit files in neovim (using my old vimrc). Most things work fine, but I just can't get my old copy behaviour working with ghostty! With iterm2, if I selected text in a neovim window with the mouse by dragging to select or double clicking to select a word, that text was put in my macOS clipboard and I could paste it anywhere. With ghostty this no longer works. Pasting works fine, but I can't get the copy bit working. I can copy into the macOS clipboard with Mouse copy does work outside neovim - I can copy from my shell or from less etc. ghostty configtheme = Monokai Pro Light
copy-on-select = true ~/.tmux.conf on linux server# Use Ctrl-s as my prefix key
unbind C-b
set-option -g prefix C-s
bind-key C-s send-prefix
# Shift + Left Arrow to move to the previous window
bind -n S-Left previous-window
# Shift + Right Arrow to move to the next window
bind -n S-Right next-window
# Clipboard integration
set -g set-clipboard external ~/.config/nvim/init.vim on linux serverset runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vim/vimrc
" Sorta like the vim viminfo settings.
set shada='100,<50,s10,h,:200,/100,f1,n~/.local/state/nvim/shada/main.shada mouse-related bits from vimrcif !has('gui_running') && &term =~ '^\%(screen\|tmux\)'
if !(has('nvim'))
" Better mouse support, see :help 'ttymouse'
set ttymouse=sgr
else
set mouse=a
endif
endif I know this is probably not directly related to ghostty, but it does work with iterm2 and not with ghostty. Any ideas? Cheers, Dave |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Great minds think alike, I just came here looking for answers to the same question. I'll let you know if I figure something out. |
Beta Was this translation helpful? Give feedback.
-
You can disable all the new mouse support with the following in your vimrc, and that works for my purposes. if (has('nvim'))
set mouse=
endif Plus This allows you to keep the fancy new mouse features enabled, but also easily select and copy buffer text as well as the current filename from the statusline into your clipboard. Full help text: :help mouse
'mouse' string (default "nvi")
global
Enables mouse support. For example, to enable the mouse in Normal mode
and Visual mode:
set mouse=nv
To temporarily disable mouse support, hold the shift key while using
the mouse.
Mouse support can be enabled for different modes:
n Normal mode
v Visual mode
i Insert mode
c Command-line mode
h all previous modes when editing a help file
a all previous modes
r for hit-enter and more-prompt prompt
Left-click anywhere in a text buffer to place the cursor there. This
works with operators too, e.g. type d then left-click to delete text
from the current cursor position to the position where you clicked.
Drag the status-line or vertical separator of a window to resize it.
If enabled for "v" (Visual mode) then double-click selects word-wise,
triple-click makes it line-wise, and quadruple-click makes it
rectangular block-wise.
For scrolling with a mouse wheel see scroll-mouse-wheel.
Note: When enabling the mouse in a terminal, copy/paste will use the
"* register if possible. See also 'clipboard'. |
Beta Was this translation helpful? Give feedback.
You can disable all the new mouse support with the following in your vimrc, and that works for my purposes.
Plus
:help mouse
has To temporarily disable mouse support, hold the shift key while using the mouse.This allows you to keep the fancy new mouse features enabled, but also easily select and copy buffer text as well as the current filename from the statusline into your clipboard.
Full help text: