7

I just switched from using terminator to termite today. I also Installed Fish and oh my fish, Spent a couple hours configuring everything, but when I went to start a tmux session to get some work done it returned open terminal failed: can't use /dev/tty.

I set Fish to my default shell. tmux works fine in gnome terminal and in xterm. But they both open a bash shell when I start a new tmux session. When I open terminator it opens with this error Unsupported use of '='. To run 'bash' with a modified environment, please use 'env TERM=xterm-256color bash…' fish: TERM=xterm-256color bash -l

I'm not to concerned with the terminator problem, and tmux opening a bash shell when opened from fish is a secondary issue. I bring them up in case they might point to the issue.

I'm concerned why termite is throwing an open terminal failed error when I try to invoke tmux. Any idea on how I can fix this or why its happening?

Ubuntu 16.04 Fish 2.2

4 Answers 4

3

The bug.

( exec </dev/tty; TMUX= tmux )

The explanation. You need all 3 fds pointing to the TTY for tmux to work.

ls -la /proc/$$/fd; ( exec </dev/tty; ls -la /proc/$$/fd; TMUX= tmux )

A failed attempt at a fix. It's not good enough to point to the same tty. &0, &1 and &2 must share a pointer to the tty.

export TTY=$(tty); ls -la /proc/$$/fd; ( exec </dev/tty; ls -la /proc/$$/fd; exec <$TTY; ls -la /proc/$$/fd; TMUX= tmux )

The fix. &1 still points to the same thing that &0 used to point to, so use it to resume.

( exec </dev/tty; exec <&1; TMUX= tmux )
1

[This may be an off-topic answer, but this post is the first hit when I Googled "tmux /dev/tty error".]

I experienced a similar problem when accessing through SSH and found a "no-brainer" solution ==> to restart the SSH connection :) Here goes how I first arrived at the /dev/tty error:

  • SSH access to a Ubuntu system,
  • installed as Windows WSL on a Win-10 machine
  • The SSH session is initialized by another WSL system on another Windows 10 machine, via ConEmu

I just got the SSH to work, and have just spent minutes on copying in my older settings into ~/.tmux.conf and installing fish + omf.


Initializing a new SSH session addressed all the concern for me.

Within the same SSH session, things were a bit off ==> I was prompted with the following error:

open terminal failed: can't use /dev/tty

However, without changing any specific setting, firing up a new "tab" in ConEmu and initializing another SSH session to the same destination machine have solved all the trouble. Not more /dev/tty error.

1

uninstall tmux before installing omf fish. When you finish installing omf fish. Reinstall tmux. That worked for me!

1
  • I've just installed oh-my-fish and tried to launch tmux in the same fish session, I got the same error as OP. After opening a new fish session tmux launched without problems, I haven't done any special tmux reinstallations
    – amordo
    Dec 4, 2022 at 11:37
-1

I'm not sure what termite gains you over gnome-terminal. termite has a "selection mode", but if you are running tmux inside termite, then tmux already has a similar selection mode you can use. If you want to launch a different shell besides bash inside Tmux, see the Tmux default-shell configuration option.

The number one search result for tmux termite is about the problem they have working together.

The practical solution here seems to be to remove termite from the equation.

1
  • That issue is for neither tmux nor termite, but someone's pimped out tmux config (including all that powerline cruft). To conclude from that the problem is with termite is a long, and completely unjustified, jump.
    – jasonwryan
    Nov 14, 2017 at 20:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .