Skip to content

Instantly share code, notes, and snippets.

@henrik
Created July 26, 2012 12:15
Show Gist options
  • Select an option

  • Save henrik/3181718 to your computer and use it in GitHub Desktop.

Select an option

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

maletor commented Aug 1, 2012

Copy link
Copy Markdown

Perfect.

@jzgit

jzgit commented Aug 2, 2012

Copy link
Copy Markdown

Thanks for posting this!

@deftsp

deftsp commented Aug 4, 2012

Copy link
Copy Markdown

Thanks very much.

@jkp

jkp commented Aug 19, 2012

Copy link
Copy Markdown

Fixed upstream now :)

@greggroth

Copy link
Copy Markdown

👍

@aokolish

Copy link
Copy Markdown

👍 thanks

@garyaj

garyaj commented Oct 26, 2013

Copy link
Copy Markdown

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

@tawrahim

Copy link
Copy Markdown

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

lenage commented Jul 15, 2014

Copy link
Copy Markdown

Thank you very much, It works like a charm

@phstc

phstc commented Sep 28, 2014

Copy link
Copy Markdown

Fixes the problem on Yosemite too. Thanks 🍻

@HelloGrayson

Copy link
Copy Markdown

Nice :)

@dep-deprecated

Copy link
Copy Markdown

God bless the internet.

@fr1sk

fr1sk commented Jul 10, 2018

Copy link
Copy Markdown

ty, works on high sierra 10.13.5

@artanikin

Copy link
Copy Markdown

Thank you!

@henrik

henrik commented Sep 26, 2018

Copy link
Copy Markdown
Author

Glad it's still helpful ❤️ :)

@davybolivar

Copy link
Copy Markdown

How to fix for Mojave?

@femilofin

Copy link
Copy Markdown

Here for Mojave too

@marceloboeira

Copy link
Copy Markdown

Every new macOS release I endup here 😆

@marceloboeira

Copy link
Copy Markdown

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

@tsai-jimmy

Copy link
Copy Markdown

Thanks

@miguelmota

Copy link
Copy Markdown

Fix for macOS Mojave

brew upgrade reattach-to-user-namespace

@kleinjm

kleinjm commented Oct 9, 2019

Copy link
Copy Markdown

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

@jward7

jward7 commented Apr 3, 2020

Copy link
Copy Markdown

Still helpful in 2020. Worked for me.

@MSqueaks

MSqueaks commented Sep 6, 2020

Copy link
Copy Markdown

Thanks for posting.

@arnawldo

Copy link
Copy Markdown

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

@mattbontrager

Copy link
Copy Markdown

Cheers! (works when updating to Big Sur)

@mylix

mylix commented Apr 19, 2021

Copy link
Copy Markdown

Worky, works after upgrade to Bigsur!

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