tmux: copy mode stops execution of shell command - execution

when i use the copy mode to scroll in my tmux version while some other program runs in this pane, execution seems to be halted until i return to "normal mode".
My tmux version is 1.8.
Is there an option to change this behaviour?

No, there is no way to change this. Later versions will exit copy mode if you don't use it for a while (180 seconds IIRC) to stop programs blocking forever. 1.8 is very old.

Related

Node wrapper to start a terminal application like vim, emacs, tmux

TLDR; how can I run a node process from the terminal, start a process from node, exit the node process and have the process be attached to the parent terminal?
I am writing a node terminal application which should end by starting a new terminal application (e.g. vim, emacs, tmux). I want this application to run as if is was executed manually in the terminal that started the node application.
My current workaround for tmux is to run the node application, which sets up a new tmux session and echoes a tmux attach-session command just before the application exists. The user can then type this command manually in the terminal and execute it. Now the tmux session runs attached to the terminal.
I would want to move the attach command into the node application, but have the same end results. I.e. the node application terminates and the tmux session runs attached to the terminal. This seems to me to be required to do the same for applications like emacs, vim, etc. Where I cannot decouple the setup and attach. (For all I know vim and emacs can handle this decoupling, and I would be interested in knowing, but the original question asks for a general solution for any terminal application).
By attached, I mean as if the command/program was executed manually in the terminal.
The POSIX exec solves this problem as #Amadan has commented above. This solution does not work on windows.
The following snippet shows an example of how to do this with the kexec module.
const kexec = require("kexec");
kexec("emacs -nw");

Using tmux through Cygwin: "open terminal failed: not a terminal"

I'm trying to use tmux on a Windows Computer. I successfully installed tmux using
apt-cyg install tmux
I can confirm successful installation because I get the following:
$ tmux -V
tmux 2.3
However, when I try to type "tmux" in the console, I get the following error:
open terminal failed: not a terminal
Any thoughts?
It sounds like the terminal you're using doesn't support full tty emulation. Clients like mintty (comes with Cygwin---or should, anyway), putty, rxvt for Windows, &c. will handle that. CMD, ConEmu, and Cmder won't.
There's not much to be done here without a huge ordeal (See second comment: https://news.ycombinator.com/item?id=8577817). Unsatisfying though it may be, the best answer is to make sure you're running mintty. CYGWIN.bat should run it out of the box, so if that's not working, try running it directly from Explorer instead of from CMD. Otherwise, you might need to poke around in the batch file and make sure C:\Cygwin64\bin\mintty (or what have you) is being called.

Vim will not quit sometimes

Vim will not quit sometimes (I have saved session in which vim wont quit) after writing :q, terminal just freezes (same with gVim), I cannot do anything except force closing the terminal or window (in gVim).
Log reading attempt (nothing interesting)
I tried to run vim with log file enabled
~ vim -V9myVimLog
when I quit nothing interesting written to log, but when I close terminal (after vim has frozen) - last line says Testing the X display failed.
Without plugins (works)
I tried running ~ vim -u NONE, and then I loaded a session (which always fails to quit), and it worked ok - vim quitted. I have lots of vim plugins and I don't want to go over each one of them. (I have to modify vimrc then run +BundleInstall)
What can I do? How should I debug this? How can I identify plugin which is root of the cause?
edit:
Tern for vim
Its tren_for_vims fault. Any ideas?
This looks a problem with tern-for-vim plugin . I installed the same plugin and I am facing some issues from time to time .

Vim with vim.fireplace closes/hangs when trying to open a Clojure file

I installed vim and vim.fireplace, did lein repl and tried to open core.clj generated by lein new. I'm using Windows. A cmd window opened and tried to do lein classpath. After a few seconds gvim just closed. I tried with plain vim: I could open the file, but when I tried to evaluate someting (cqp and then typed 1 and pressed Enter) vim hangs. Vim has('python') == 1. What could be wrong?
Vim version 7.3 and fireplace version https://github.com/tpope/vim-fireplace/commit/4f6b8e52376dc9973ca0478b750578b681681b55
It seems that your are trying to evaluate a form without any repl connected.
Then vim-fireplace will fall back to use java clojure.main which assumes classpath.vim installed.
Could you check whether your vim is already connected to the repl?
BTW, why didn't you ask on issue list of vim-fireplace?

Vim at Ubuntu 11.04: Working with clipboard of Unity

The problem is, the old-way method to work with X11 clipboard (through "plus" register) doesn't work in Unity. Has anyone met the problem? And how it was solved?
The problem solves itself after GVim installation. Then "plus" register works as it should be.
Even if you do not have gvim installed or xterm_clipboard enabled, you may use xsel to manage your clipboard (install it via apt-get).
I hope my script will help you: https://github.com/FUT/config-files/blob/master/vim-dotfiles/vim/settings/clipboard.vim
Use :
sudo apt-get install vim-gtk
This will install vim with clipboard support.Run as before: vim
I don't know the unity desktop but I know that it is based on gnome libraries. So if you can use dbus to interact with unitys clipboard, you may consider writing a shell script which uses dbus to set the clipboard content. This script can in turn receive its input from vim if you assign a map to a filter command. Of course this works similarly if you know any other commandline utility which can set the clipboard content.
I used to have the following maps in .vimrc for the old dcop and klipper (the KDE clipboard) which you might customize:
:vmap k :w! $HOME/.vimclip<CR>:silent execute "!dcop klipper klipper setClipboardContents \"$(cat $HOME/.vimclip)\" &>/dev/null &"<CR>:redraw!<CR>
:nmap z :silent execute "!dcop klipper klipper getClipboardContents > $HOME/.vimclip"<CR>:r $HOME/.vimclip<CR>:redraw!<CR>
E.g. to copy press k after making a selection in visual mode. Note, that it copies and pasts line wise.
I have faced the problem again after while. Must say I use vim in GNOME Terminal, not GVim that is also installed.
What is interesting the plus register stopped working approximately at the same time on different computers of mine.
First I though it was a bug because the graphical version was installed as before. But at the end I just started GVim and tested the plus register there. It was working. After that the register began working in the terminal too.
So if you meet the problem again, when you have already installed GVim, just start it. This should help.

Resources