inside shell when
which conda
I get
/anaconda3/bin/conda
while inside tmux I get
/anaconda3/condabin/conda
Anyone knows the difference or something wrong with my config?
Finally I found an answer here that worked for me. Basically as #shouya said there, this problem is because tmux's run-shell command runs a shell which doesn't read from user configs, thus tmux installed in /usr/local/bin will not be found. And best solution is to insert the following line:
set-environment -g PATH "/usr/local/bin:/bin:/usr/bin"
before the first run-shell/run command in your ~/.tmux.conf file, and leave everything else untouched.
Then reload ~/.tmux.conf file by
tmux source-file ~/.tmux.conf
Related
First off:
I'm using tmux 2.5 installed via homebrew on OS X 10.12, in iTerm 2 (though the problem appears in Terminal.app as well). My tmux.conf is on Github, along with my zshrc.
The problem: Seemingly out of nowhere, I started seeing an issue with typing in the prompt. Typing keys once will display them twice, and backspacing will move the cursor forward and redraw characters already present on the line. This only happens inside of a tmux session, and not inside my "regular" terminal.
Here's a gif of the issue. In this gif, I type 1234567890, then hit backspace 9 times, and type ls. Note that 0 only shows up once, and lls with a duplicated l runs the ls command as expected.
Hopefully I just hit a weird key combo on accident, but I've been stuck on this for a while.
Thanks for any help!
Installing tmux-256color for macOS as in this guide solves the problem.
Running the following as mentioned in a github issue solved the problem for me:
brew install ncurses
$(brew --prefix)/opt/ncurses/bin/infocmp tmux-256color > ~/tmux-256color.info
tic -xe tmux-256color tmux-256color.info
infocmp tmux-256color | head
I'm also running into this issue as well. I encountered the problem similar to #artemave, by trying to change the set -g default-terminal "screen-256color" to set -g default-terminal "tmux-256color". The goal of doing this was to gain italics, per the tmux FAQ.
#taylor's answer didn't work for me, as I didn't have that command.
I managed to determine that:
The issue doesn't occur with bash
When running a blank .zshrc, backspacing creates new blank lines, but I'm not seeing the character duplication
Using tmux-256color will successfully give italic fonts
Using TERM=xterm-256color and TERM=konsole-256color does not change the above effects
Using xfce4terminal (0.8.9.1), Konsole (19.12.3), or URXVT (9.22) doesn't change the above behavior
I wasn't able to really "fix" the issue, as the even going down to a blank .tmux.conf wasn't able to change anything. Instead, I just needed to change it to anything else. xterm-256color was suggested in this issue, but I found nearly anything else would work fine.
I'll keep working on it and update this answer if I find anything else.
Edit: This tmux issue is the exact issue we're running into. I'll see if the solutions there work
https://github.com/tmux/tmux/issues/597
Edit 2: I've submitted a GitHub issue with tmux. No real results yet, but it does offer some guidance on things to check on.
The problem seems to be fixed after commenting out this line from my tmux.conf:
set -g default-command "reattach-to-user-namespace -l zsh"
I also had to manually run tmux kill-server instead of relying on just re-sourcing my conf file.
When I find some time, I'll look more into what went wrong here...
Bear with me for a sec while I explain the motivation for my question.
I've tmux set so that it shows the current working directory on the tmux status line. This works fine except in the following scenario:
While on a bash shell, I fire up ipython. On ipython, I change directory to some other place in my disk (doing 'cd some_place'). This works in the sense that I'm cd'ed to that directory, but the tmux status line still shows the original directory from which I fired ipython as the current working directory, instead of the one that I'm now.
I know that this is no bug, tmux is just showing me the original directory, all the "cd's" that I launch from ipython are transparent to that hosting shell.
My question is: Can you think of a way to make tmux get the current working directory from ipython instead of the original (hosting) shell from which it was launched?
Thanks in advance for all your help.
Drawing from this answer, you could manually update the status using a command like the one provided in the linked answer:
!tmux set -qg status-left "#S #P $(pwd)"
Includes the ! for ipython shell calls. This is, however, a manual action. Maybe there is a way to run it automatically.
I have Sublime Text as an alias so I can call it from the terminal on MacOS.
Since I started using tmux, Running the following command opens sublime but not on the current directory. It's like aliases are not accepting arguments on tmux.
subl .
Without tmux this command works fine.
Any known issue with tmux alias arguments?
This answer from SuperUser did the trick for me.
brew install reattach-to-user-namespace
And then append the following to your ~/.tmux.conf
set-option -g default-command "reattach-to-user-namespace -l zsh"
Lastly, source the config file for tmux
tmux source ~/.tmux.conf
I use subl . all the time! It's a shame you've trained yourself not to use this helpful command.
I ran into this same issue after reinstalling Homebrew. Not sure why it happened but i was able to resolve it but just add the following line to the end of my .bash_profile.
alias subl='open -a "/Applications/Sublime Text.app"'
Then closing and reopening the terminal session or by running source ~/.bash_profile to reload the profile.
Suddenly, both my screen/tmux started changing my windows' names after every command. They keep changing the name to the value of $PROMPT_COMMAND on every single action on the terminal, even after manually renaming them (by Ctrl+A A on screen or Ctrl+B on tmux).
On tmux I already tried to change the tmux.conf settings to disable window auto renaming off, but seems that it was ignored.
I am using bash without the standard /etc/bashrc configuration file. My distro is Fedora 18.
Add the following to your tmux config file:
set-option -g allow-rename off
Put this at the end of the .tmux.conf file:
set-window-option -g automatic-rename off
set-option -g allow-rename off
then reload the tmux config file (ctrl + b > : > source-file ~/.tmux.conf).
First, if l0b0's answer fixed your problem could you please mark it as a solution? Second, for those of use who stumble upon this question and are using fedora 19 this redhat bug report may be of interest. It seems like the default value of $PROMPT_COMMAND set by /etc/bashrc has been changed recently. I reverted to the previous behavior like this:
echo 'printf "\033]0;%s#%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"' > /etc/sysconfig/bash-prompt-screen
chmod a+rx /etc/sysconfig/bash-prompt-screen
Check whether your PS1 (plus PS2, PS3 or PS4 if those are set) is changing the title:
printf %q "$PS1" | grep -F '\\033'
I don't know what has happened, but in my Terminal on Mac OSX 10.5 it can no longer find my sudo command, or find command, etc. They are there because if I put /usr/bin/sudo or /usr/bin/find it works fine...
My .bash_login file looks like this:
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin$PATH"
My .bash_profile file looks like this:
export PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Python/2.5/site-packages/django_trunk/django/bin:/usr/local/mysql/bin:/usr/bin/sudo$PATH"
I'll say now, I don't really know what I'm doing with the Terminal. I'm just a beginner to it all, and I must of done something for the environment variables (is that what they're called?) to be lost. I presumed I'd just have to make sure the /usr/bin/ path is in my bash files, but they are, and it doesn't seem to work. Please help!
Also, when I do use the /usr/bin/find command, it says "Permission denied" to me, even though I am logged into Mac OSX as the System Administrator account. I don't understand.
Any help would be grand. Thank you - James
It looks like both of your PATH exports are malformed:
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin$PATH"
The end bit there won't work. It should be:
export PATH=/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin:$PATH
Notice the colon before '$PATH'? It's important ;)
Also, the double quotes are not necessary.
If this doesn't work, we will need more information. It is possible that something else is modifying your path even after your shell configurations are loaded.
Can you post the results of:
$ echo $PATH
Configuration files are not always a good indication of the current environment variables, since they are modified by many programs and files, all across your system. To see all of your environment variables, you can run:
$ env
This should fix the problem completely and permanently.
first, export environment paths by using below command in the terminal.
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
now you have the commands you want. (eg. try ls. You'll see the command is working). But this is only for the current session. If you close the terminal and open a new one, you will have the previous issue. To make this change permanent, use below command,
go to home directory
cd ~
open .bash_profile file in nano / vim (I'm using nano here)
nano .bash_profile
This will open up nano editor. In a new line, paste the following;
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:$PATH
press 'control'+'o' to save (WriteOut) and 'control'+'x' to exit nano.
All done ! Now try the commands.
Check out --- http://www.sweeting.org/mark/blog/2008/05/26/mac-os-x-tip-setting-path-environment-variables
I went trough the same issue and here is how I solved it.
First of all I reverted the file to its original doing this way
/usr/bin/nano ~/.bash_profile
In my case I was not able to make work any command alias. Even vi or vim didnt work without specifying the full path of that command.
If nano is not installed just replace nano in the command by the editor installed
After that just restart the computer. In my case as I said bellow I could not use any command. When trying to do /usr/bin/source ~/.bash_profile
that command failed. So I had to restart the OS and it worked