I started to ask this question but answered it while I had it open. I'm going to post this question, follow it up with my solution and leave it open to other potential solutions.
<
backstory>
I'm a tmux and vim user. I like remote vim work as I don't have to worry about Ubuntu development machines kirking out when a flash movie gives me a kernel panic. Running tmux means that open files are waiting for me after I reboot and I can carry on from where I left off. I've had problems with vim running in a tmux session when I connect like so:
ssh example.com -t 'tmux attach'
UTF-8 issues crop up that don't crop up when shelling in normally and just attaching to a tmux session manually.
<
/backstory>
So I want a reusable method of starting something on ssh login, that doesn't affect any of the other things I have configured in my .zshrc
(or your .bashrc
if you still use bash) that may be required for my development environment, that doesn't appear when I'm occasionally working locally on the very said machine.
ssh example.com -t 'tmux attach'
isn't because it has problems loading my environment but because I've had issues with UTF-8 character display; this issue doesn't exist when connecting in the conventional manner. This is why this question is about running scripts immediately after connecting over SSH. – connrs Mar 23 '11 at 09:17.profile
? I assumed the issue was due to incorrectly set locales on the target machine, which your/etc/profile
or.profile
fixed. The locale issue is probably fixable with more information. – Gilles 'SO- stop being evil' Mar 23 '11 at 19:33