0

I'm trying to write a script to setup tmux for a dev environment, in WSL Windows 10, but it keeps throwing this error. What is odd is that if I copy this script to a subdirectory or somewhere else, sometimes it works (depending on where). The behavior is very strange, as if I copy the code to another file and run in another directory, sometimes it gives this error, sometimes it runs but kind of breaks, frustrating!

Here is the tmux bash script:

tmux.sh

#!/bin/sh
tmux new-session -d
tmux attach-session -d
tmux split-window -v
tmux split-window -h

When I run it it gives the errors:

rw3iss@rw3iss:/mnt/c/Users/Ryan/Sites/testsite/src$ ./tmux.sh
tmux: unknown option --
no server running on /tmp/tmux-1000/default
tmux: unknown option --
no server running on /tmp/tmux-1000/default
: not found: ./dev.sh:
tmux: unknown option --
no server running on /tmp/tmux-1000/default
no server running on /tmp/tmux-1000/default

Any ideas, please?

Ryan Weiss
  • 1,308
  • 1
  • 14
  • 36
  • 4
    `dos2unix -f tmux.sh` and retry – P.... May 31 '19 at 19:03
  • Ah man. Not even gonna ask, but that worked! Thank you!! – Ryan Weiss May 31 '19 at 19:07
  • 1
    You can delete this question – P.... May 31 '19 at 19:21
  • there are thousands of Qs already here where `dos2unix` was the solution. You looked for solution but didn't find it, right;-? So please delete this as the likelyhood of it helping anyone else is miniscual. (IMHO). Glad you solved your problem, stop using a windows editor for *nix work ;-). Good luck. – shellter May 31 '19 at 19:22
  • So should I return the Lenovo and stick with an old macbook air? Jk. WSL is the only *nix environment available to us now. It's not bad, just crap like this sometimes. Visual Studio Code is a pretty good editor! I've used many. What do you use on linux? Don't tell me vi/vim :p – Ryan Weiss May 31 '19 at 19:25
  • @shellter Yeah, I do a quick search for the error, didn't see it, then start typing, look at SO suggestions, didn't see it, so posted, in case others get the same error, as WSL is relatively new. – Ryan Weiss May 31 '19 at 19:26

0 Answers0