I have set -g mouse on in my .tmux.conf – and only this (I removed everything else from it to try an locate the issue).
When I select something with the mouse, sometimes it stays selected and I can copy it normally, but more often, the selection disappears as soon as I release the mouse button. When this happens I end up having everything I ever had in my clipboard concatenated to one large string in my clipboard.
I cleared all three selections with xsel before, but still after this things I had in my clipboard hours ago, even before I started the current tmux server reappear in the clipboard.
What is causing this, is this intended behavior and how can I stop it?
Where are my previous selections saved and by whom?
What I did to narrow it down:
mv .tmux.conf .tmux.conf.bk; echo "set -g mouse on" > .tmux.conf
mv .tmux .tmux.bk
xsel -c -p
xsel -c -s
xsel -c -b
tmux kill-server
made sure there is not /etc/tmux.conf
run as different user, without any bashrc
It still occurs.
Related
At some point, whenever I use vi from the command line (windows 10/WSL) it starts up in insert mode, meaning that everything I usually do to navigate ends up adding stuff to the file, wasting time having to clean it up.
I didn't have a vimrc file, and there doesn't seem to be anything in my bash rc files to modify vi behavior. Any ideas what I may have done or any ideas how to stop this behavior? I'm using Ubuntu-20.04
FWIW, adding a .vimrc file with tab related settings didn't change it's behavior. I looked at the /etc/vimrc file, and nothing inside it seemed relevant.
After plowing through google search and trying everything I understand about configuring 'vim' and doing comparison tests, I think:
This behavior is specific to Windows Terminal when opening a WSL terminal. Using WSL's "native" terminal (i.e., clicking the "Ubuntu 20.04 LTS" menu in the "Start" menu) doesn't have this problem.
My original motivation for switching to Windows Terminal is for its multi-tab feature. But this new behavior is crazy -- it works against years of my muscle memory of using "vi", and I'm almost certain that one day I'll accidentally update some configuration file while reading it in "vi". And, I cannot re-train a new muscle memory because all the rest of the UNIX world (e.g., when I SSH into a remote server) hasn't changed. This is like constantly switching between a Mac keyboard and a PC keyboard where the Ctrl key, etc., are in different places.
My solution: I switched to MobaXterm. It has multi-tab support, and is actually richer in features compared to Windows Terminal.
Please run the following:
alias | grep vim
sudo find / -name .vimrc 2>/dev/null
These commands should show you all the places to check, change the alias or fix the .vimrc files found.
Do you find it always going into edit mode, when you vim a file directly and when you use vim as the git commit editor for example?
EDIT:
You could also try which -a vim or whereis vim to see if you have multiple versions. Or failing that sudo find / -name vim 2>/dev/null
here is a better solution. I downloaded the binary.
https://github.com/lxhillwind/vim-bin/releases/tag/v9.0.0978
Put the vim command in /usr/bin/vi
Put the runtime in:
/usr/local/share/vim/runtim
sudo apt remove vim vim-common vim-runtime vim-tiny
sudo apt purge vim vim-common vim-doc vim-runtime vim-tiny
The second line actually gets rid of residual-defaults.
There is also a defaults.vim someplace on the system. I just nuked it.
I went through and made sure there were no aliases or vi or vim configuration files, but still no luck.
This is a horrible solution, but the only thing that is keeping my sanity right now.
vi -c ":imap jj "
You can alias it in your .bashrc. Looking into better solutions.
I have tried the following
at the end of my .screenrc
conda activate ${CONDA_DEFAULT_ENV}
in my bash terminal, I typed:
conda activate atwork3
echo ${CONDA_DEFAULT_ENV}
> atwork3
screen -S test
> # starts screen OK but comes with env base
echo ${CONDA_DEFAULT_ENV}
> base
I read that you cannot put bad commands in the .screenrc or the full file gets ignored which is probably what happens to me here
I also tried things from how-to-open-tabs-windows-in-gnu-screen-execute-commands-within-each-one but did not yet get the real stuff behind these comments and how to specify a command in .screenrc or at screen call (examples are weird to me)
Anyone could please give an example on how to change env while entering screen to keep the conda env of the mother bash terminal! (also in subscreens!)
Running arch, when developing rails the console's tab completion for everything is incredibly slow. Even if the list it returns is inherently small.
User.n for instance shouldn't return a horrid number of options, but it will basically halt for upwards of 20 seconds before doing anything. Behavior repeats on every attempt. Any idea on how to fix?
I fixed this by removing the following lines from the file /etc/profile:
PATH="$PATH:$(ruby -e 'print Gem.user_dir')/bin"
export GEM_HOME=$HOME/.gem
export PATH
And adding the following to ~/.profile
# make rails gems work
PATH="$PATH:$(ruby -e 'print Gem.user_dir')/bin"
export GEM_HOME=$HOME/.gem
Strangely, I had assumed the -f option was for "force", not for "file".
I ran tar -xz because I wanted to see if any files would be overwritten. Now it has extracted all the files but has not returned control back to me. Should I just kill the process? Is it waiting for input?
-f commands tar to read the archive from a file. Without it, it tries to read it from stdin.
You can input Ctrl-C to kill it or Ctrl-D (Ctrl-Z in Windows) to send it EOF (at which point, it'll probably complain about incorrect archive format).
Without an -f option, tar will attempt to read from the TAPE device specified by the TAPE environment variable, or a file built into tar (usually something like /dev/st0 or stdin) if TAPE isn't set to anything.
I have a button in my Preference Bundle for my iOS tweak and I'm trying to have it delete a cache file so that the tweak will work properly.
The function for the button is here
- (void)respring {
system("cd /var/mobile/Library/Caches/com.apple.keyboards");
system("rm -R images");
system("rm version");
}
When I go into iFile afterwords the file is still there and hasn't deleted. Is there a way around this?
I haven't tested this, but my guess is that you are running three separate commands, with system().
So, you run one command to change directory, and then nothing else.
The second command to rm -R images is then run by itself, and not performed with /var/mobile/Library/Caches as the current directory.
You might try simply combining all three commands into one:
system("cd /var/mobile/Library/Caches/com.apple.keyboards; rm -R images; rm version");
If that doesn't work, report back and maybe there's another problem.