Skip to content

Instantly share code, notes, and snippets.

@henrik
Created July 26, 2012 12:15
Show Gist options
  • Save henrik/3181718 to your computer and use it in GitHub Desktop.
Save henrik/3181718 to your computer and use it in GitHub Desktop.
Fix "unsupported new OS, trying as if it were 10.6-10.7" from reattach-to-user-namespace on Mountain Lion (probably in tmux).
# Start by checking if they fixed it upstream:
brew update
brew upgrade reattach-to-user-namespace
# If it says it's already installed, they haven't fixed it upstream. So do this:
# Edit the recipe:
brew edit reattach-to-user-namespace
# In your editor, change:
# dadea0aa48259c704d0b412b9588de2f5623e323 (on line 6) to ece1935953593d05e98d8c3ee8f956b2429d633f
# dadea0 (on line 7) to ece193
# Install the edited version:
brew upgrade reattach-to-user-namespace
# Done!
@maletor
Copy link

maletor commented Aug 1, 2012

Perfect.

@jzgit
Copy link

jzgit commented Aug 2, 2012

Thanks for posting this!

@deftsp
Copy link

deftsp commented Aug 4, 2012

Thanks very much.

@jkp
Copy link

jkp commented Aug 19, 2012

Fixed upstream now :)

@greggroth
Copy link

👍

@aokolish
Copy link

👍 thanks

@garyaj
Copy link

garyaj commented Oct 26, 2013

Same warning was showing up in Mavericks. Same fix. Many thanks.

@tawrahim
Copy link

Hmm is just me or something else, it I don't think the line 7 matches your tip. I did the following but still had no luck

require 'formula'

class ReattachToUserNamespace < Formula
  homepage 'https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard'
  url 'https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/archive/v2.2.tar.gz'
  sha1 'ece1935953593d05e98d8c3ee8f956b2429d633f'

  head 'https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard.git'

  option 'wrap-pbcopy-and-pbpaste', 'Include wrappers for pbcopy/pbpaste that shim in this fix'
  option 'wrap-launchctl', 'Include wrapper for launchctl with this fix'

  def install
    system "make"
    bin.install "reattach-to-user-namespace"
    wrap_pbpasteboard_commands if build.include? 'wrap-pbcopy-and-pbpaste'
    wrap_launchctl if build.include? 'wrap-launchctl'
  end

  def wrap_pbpasteboard_commands
    make_executable_with_content('pbcopy', 'cat - | reattach-to-user-namespace /usr/bin/pbcopy')
    make_executable_with_content('pbpaste', 'reattach-to-user-namespace /usr/bin/pbpaste')
  end

  def wrap_launchctl
    make_executable_with_content('launchctl', 'reattach-to-user-namespace /bin/launchctl "$@"')
  end

  def make_executable_with_content(executable_name, content_lines)
    executable = bin.join(executable_name)
    content = [*content_lines].unshift("#!/bin/sh").join("\n")
    executable.write(content)
    executable.chmod(0755)
  end
end

@lenage
Copy link

lenage commented Jul 15, 2014

Thank you very much, It works like a charm

@phstc
Copy link

phstc commented Sep 28, 2014

Fixes the problem on Yosemite too. Thanks 🍻

@HelloGrayson
Copy link

Nice :)

@dep-deprecated
Copy link

God bless the internet.

@fr1sk
Copy link

fr1sk commented Jul 10, 2018

ty, works on high sierra 10.13.5

@artanikin
Copy link

Thank you!

@henrik
Copy link
Author

henrik commented Sep 26, 2018

Glad it's still helpful ❤️ :)

@davybolivar
Copy link

How to fix for Mojave?

@femilofin
Copy link

Here for Mojave too

@marceloboeira
Copy link

Every new macOS release I endup here 😆

@marceloboeira
Copy link

Mojave -> brew upgrade reattach-to-user-namespace works straight away.

@tsai-jimmy
Copy link

Thanks

@miguelmota
Copy link

Fix for macOS Mojave

brew upgrade reattach-to-user-namespace

@kleinjm
Copy link

kleinjm commented Oct 9, 2019

brew upgrade reattach-to-user-namespace works for macOS Catalina as well

@jward7
Copy link

jward7 commented Apr 3, 2020

Still helpful in 2020. Worked for me.

@MSqueaks
Copy link

MSqueaks commented Sep 6, 2020

Thanks for posting.

@arnawldo
Copy link

This worked for me after the Big-Sur update. Thanks for sharing.

@mattbontrager
Copy link

Cheers! (works when updating to Big Sur)

@mylix
Copy link

mylix commented Apr 19, 2021

Worky, works after upgrade to Bigsur!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment