i have started using tmux recent past . So far so good .
while exploring the option , i found an option as
#Enable names for panes
set -g pane-border-status top --> I see this as working with no issue.
#Automatically assign a name
set -g pane-border-format "#P: #{pane_current_command}" --> This is command is not per my expectation
I log into terminal where i enabled the tmux , and then i log onto a taxi server and then to my application server. My expectation is when i going aound the paths on my app server , i want the pane window to show that path .
can some one help me ? if any other command you as well would be great.
wanted to let you know -
i have tried modifying .bashrc as well . It is working fine , if i am using putty , but not while on tmux.
I am using tmux on windows machine i.e., mintty ( not on ubuntu , mac x )
Related
I'm running ubuntu 1804 on windows using the WSL. Everything is set up fine and works correctly. I've also installed ZSH and oh-my-zsh, again this is all good and everything looks like its working fine. Everything except the arrow keys whilst using vim or man pages or some other command line tools.
The up and down keys work on the command line when scrolling through history and also for select commands like nano. Also if I boot into bash rather than zsh the arrow keys do work in vim and man pages, in fact they work everywhere.
If i boot into bash, then switch to zsh on the command line manually the arrow keys then work everywhere.
So my cmder config for zsh
c:/_distros/ubuntu1804/ubuntu1804.exe -c zsh -cur_console:pm
and for bash
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt
The one for bash uses the conemu-cyg-64.exe program that comes from conemu which is a symbiont of POSIX enabled pty and WinAPI full-featured terminal.
Apparently you can use this tool with zsh but i cant manage to make it work i get the error
{PID:10592} failed to run shell (2): No such file or directory
{PID:10592} shell: `/usr/bin/zsh` `-l` `-i`
{PID:10592} dir: `/cygdrive/c/Program Files/cmder`
ConEmuC: Root process was alive less than 10 sec, ExitCode=0.
Press Enter or Esc to close console...
and this is the task in cmder
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe /usr/bin/zsh -l -i -cur_console:pm:/mnt
So I think that if i can boot into zsh using conemu-cyg-64 that the cursor keys will probably work in commands like vim and the man pages. Any help or advice getting that working would be brilliant.
EDIT:
On my ubuntu install zsh is installed at /usr/bin/zsh, but there is no file or folder /cygdrive/c/Program Files/cmder
Many thanks to #Maximus for pointing me in the right direction. The answer was right under my nose at the bash on windows page of conemu. A small change to the command i was using before. the zsh needs to go on the end rather than before the --wsl.
The correct task to ensure that cursor keys work on all apps in the terminal is:
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pnm:/mnt -t zsh -l
I have as on single command "new" in my $HOME/.tmux.conf so I can call tmux attach as a command automatically using ssh. Recently (I believe since version 2.7) I am seeing a strange effect that if I use "tmux attach" and I do not have a session running a new session is started as expected (as I have the new command in my .tmux.conf) but the current working directory is "." if I use echo $PWD. If I use tmux without arguments to create a new session anyways I get a normal $PWD, in my case it is $HOME as I always call tmux right after logging in.
This wreaks havoc with a few shell scripts, for example the mvim script is not able to open any files in macvim any longer. If I use "cd $HOME" after using tmux attach for the first time when it created a new default session it works OK. Does anybody have any clue on how to fix that without issuing "cd $HOME"?
I just found that tmux version 2.8 fixes the problem.
I am using a previous version of Vim-R-Plugin and pretty comfortable about its settings. Recently I upgraded the Linux system and got message never before "Start 'tmux' before Vim. The X Window system is required to run R in an external terminal.". The issue is, if I start tmux manually, the vim background were also changed weirdly and further ,rc will start a R console in a split window rather than a new window. Does somebody know the reasons and how to fix it?
This is due to styles and handling of tmux 'emulated terminal'.
At first try to simply run
tmux -2
If it does not help try add in ~/.tmux.conf:
set -g default-terminal "screen-256color"
I'm able to plot() in R from a regular terminal, but I can't do so from a tmux pseudo-tty. png() works fine but I can't write to the monitor.
UPDATE: Sorry, there's no error message. R merely fails to "print" to the monitor.
UPDATE 2: ctrl+b :showenv returns
DISPLAY=:0
SSH_AGENT_PID=1786
-SSH_ASKPASS
SSH_AUTH_SOCK=/tmp/ssh-ebteUtjL1719/agent.1719
-SSH_CONNECTION
WINDOWID=18928777
XAUTHORITY=/home/me/.Xauthority
fix in R
Sys.getenv('DISPLAY')
Sys.setenv("DISPLAY"=":0.0")
X11()
qplot(...)
.Devices
device.list()
should do it.
fix in tmux
You can also type Ctrl+b, :setenv DISPLAY :0.0 to change it from tmux rather than from R.
Why does this happen?
It might have to do with where you open the tmux (virtual terminal versus GNOME terminal) when you initially run the command tmux to initiate the session manager.
It's good to echo $DISPLAY in the terminal and Sys.getenv("DISPLAY") in R. See stuff like https://unix.stackexchange.com/questions/31283/error-in-r-unable-to-open-connection-to-x11
You can also run capabilities() in R and if capabilities()$X11 == FALSE then that's what to work on fixing.
I messed around for a while and then was able to do X11(); qplot( my.ggplot ). Check ?X11 for a little more information too.
It would help if you included the error message, but it sounds like your DISPLAY environment variable isn't set properly inside tmux. Issue echo $DISPLAY from outside your tmux session, and make sure DISPLAY is set to the same thing inside tmux.
You can use the update-environment command in tmux to configure tmux so that it automatically updates particular tmux environment variables with their values from the external environment. See the tmux manpage for details, or search the web for "tmux update-environment" for various other pages that describe this feature.
I've been exploring use of MSys lately as an alternative, 'nix-like shell for my windows development. However, the default colors and size are driving me crazy. Anyone have any idea as to how I can change the default size, color, and / or font? Honestly, I'd be happy if I could make the default character width/height of the shell larger, but the others would be nice too...
Clarification: the msys shell is a separate app from the windows shell - the normal 'right-click-upper-left -> properties' configuration (like with the windows shell) is not present.
Looks like underneath it's firing off rxvt. Thanks!
If you're running MSYS bash from a command line, Behind the scenes it's a windows command shell window, so configuring it is just the same.
Right click on the title bar at the
top of the shell window and select
'properties'
Configure the window with the options
on the tabs on the dialog; these
should be fairly self-explanatory.
When you close the dialog, select
'Modify shortcut that started this
window' to save the configuration
back as defaults.
EDIT: If you're running the shell in an xterm or RXVT window through an X server, start the xterm window with -fg (foreground), -bg (background) and -fn (font). Can't remember what the RXVT switches are, but you should be able to see them in the man page. You can also configure them through your .Xdefaults file. Again, see the man page for details.
EDIT: Thanks Paulo - note that MSYS also comes with an X-less version of RXVT, which the OP seems to be using. Here's a link for configuring RXVT on MSYS.
Open the msys.bat file an aroun line 72 it reads like this:
rem Setup the default colors for rxvt.
if "x%MSYSBGCOLOR%" == "x" set MSYSBGCOLOR=White
if "x%MSYSFGCOLOR%" == "x" set MSYSFGCOLOR=Black
if "x%MINGW32BGCOLOR%" == "x" set MINGW32BGCOLOR=LightYellow
if "x%MINGW32FGCOLOR%" == "x" set MINGW32FGCOLOR=Navy
if "%MSYSTEM%" == "MSYS" set BGCOLOR=%MSYSBGCOLOR%
if "%MSYSTEM%" == "MSYS" set FGCOLOR=%MSYSFGCOLOR%
if "%MSYSTEM%" == "MINGW32" set BGCOLOR=%MINGW32BGCOLOR%
if "%MSYSTEM%" == "MINGW32" set FGCOLOR=%MINGW32FGCOLOR%
change the first 4 lines with the colors you like, to change the font, just bellow:
start %WD%rxvt -backspacekey -sl 2500 -fg %FGCOLOR% -bg %BGCOLOR% -sr -fn Courier-12 -tn msys -geometry 80x25 -e /bin/sh --login -i
change the Courier-12 with your favourite font and the 80x25 with your prefered window size.
I create HOME env var, which have value like 'e:\home' and put into %HOME% dir .Xdefaults file with such content:
Rxvt*background: white
Rxvt*foreground: black
Rxvt*geometry: 120x40
Rxvt*font: 7x14
Rxvt*scrollBar: on
Rxvt*saveLines: 5000
Also note that this config successfully work on Cygwin and various Unix boxes.
If you're tired of using cmd for msys git, I recommend using minty and/or ConEmu
:
to use mintty, download latest version from google code/mintty and drop it in the bin folder of git msys + make following shortcut:
"C:\Program Files (x86)\Git\bin\mintty.exe" --title "Git Bash" -w full --exec "C:\Program Files (x86)\Git\bin\sh.exe" --login -i
(set working dir to your home dir)
to use vim, make sure to read this bug report
for colors, make sure gitconfig is set to color = always
I set sublime as my default editor as vim didn't work, see notes below
note:
vim packaged with msys expects cmd terminal and won't work with mintty
interaction to enter username/password for git pushes using basic http auth won't work unless you host mitty in ConEmu. (ssh works fine on mitty by itself)
ref:
rpavlik/git-windows-mintty - notice this does not bundle latest mintty version.
/oumu/mintty-color-schemes