Opening sublime text 3 from a tmux session opens an empty file? - terminal

Whenever I try to open any file from the terminal using sublime, for example: subl ~/.zshrc, it works fine BUT when I try to do the same thing from inside of a tmux session I get an empty blank file.
I saw many people asking related questions and blaming sublime, but what I just figured out is that it's not sublimes fault! it's the relation between sublime and tmux. so how can I fix this? does it requires some sort of permission or what?

This is because Tmux does not have the root access to your system.
It opens Sublime for you but it doesn't show you the system files content.
You need to give it permission first.

I had the same issue. Dug around a bit and found this answer on SU. Installing the "Reattaching" Wrapper program to allow access to the Mac OS X pasteboard seems to solve the issue.

Related

Catalina Operation not permitted in XQuartz/Xterm

After upgrading to Catalina from High Sierra, I can not longer do simple things in my home direction (e.g., ls, etc.) under XQuartz, getting an error: Operation not permitted.
I recognize that this is due to the new access controls introduced in the previous version. There are many articles available online describing how to fix this for Terminal, by adding Full Disk access under the Security section of System Preferences. However, although it seems like an obvious variation, I don't see anything about making this work for XQuartz. And in fact, giving XQuartz and Xterm full disk access doesn't seem to solve the problem.
Has anyone understood what is going on here?
The solution, as pointed out by #dmr195 in the comments, is to add /bin/bash (or whatever shell) to the Full Disk Access list under the Security area of System Preferences.
The selector window that opens when you click the + button in that window does not allow you to navigate to /bin. However, by going there in a regular Finder window, you can drag and drop bash into the Full Disk Access list.
I was unable to get Finder to see /bin in order to drag it to the Full Disk Access (FDA) list. Solution was to create dynamic link to /bin directory from my Desktop, which finder could see.
Also helpful was using Mac's Hypterm to launch an xterm with full permissions, for example to create above link. Launch Hypterm, then update the locate database (the command is: updatedb). This will prompt you to give FDA to Hyperterm for every directory that /bin/bash also cannot see. After that, run xterm and voila, FDA.
Adding full disk access for bash will not work.
The solution is to open the Terminal app and type xterm in Terminal to open up the XQuartz, then you will have full disk access with XQuartz.

iTerm session not unique

I have a possibly simple issue, but can't resolve it. I recently downloaded iTerm and have it setup using zsh, but when using tabs they are always duplicated.
For example I open two tabs A and B using CMD+T. I type ls in A and it works as expected, but tab B also does the same! If I use the standard macOS Terminal this does not happen. It also does not occur if open two separate iTerm windows.
Any ideas?
EDIT - iTerm version is Build 3.0.15
Found the answer myself.
User error on my part, and a difference between Terminal and iTerm. I was switching tabs using CMD+SHIFT+ARROWS. This moves the tab, you need to use CMD+ARROWS to jump between tabs.

"open" command doesn't work properly inside tmux

I am trying to use the open command to open a link in Chrome from my terminal.
It works fine in plain Terminal.app or iTerm2, but doesn't work properly from tmux. What happens is: it opens a new instance of Chrome (rather than opening a new tab) and doesn't actually go to the URL.
Is there any fix for this? The reason I need this functionality is for running Mutt with urlview to open the links from emails.
Thanks.
This sounds like a problem that could be solved by installing reattach-to-user-namespace.
If you don't wanna get deep into manually solving this problem you can use one of the tmux plugins:
tmux-urlview looks like exactly what you're looking for
another solution is to use tmux-copycat + tmux-open

Why does Command + V behave like Page Up?

On OS X 10.10 (Yosemite), the keyboard shortcut to paste the clipboard Command ⌘+V behaves like Page Up.
Right now I'm able to reproduce this issue only in Mail and Evernote.
Pressing Super+v, Super+v does pageup, paste though.
I use Karabiner to remap some keys, but never Command ⌘ keys.
If I close Karabiner it doesn't change anything.
I have at some point used vim, the pbcopy terminal command, and some OS configuration from https://github.com/mathiasbynens/dotfiles/blob/master/.osx
But I don't see why this could be a problem.
Does anyone know how to fix this or why it happens?
Are you able to replicate this issue in multiple users on your machine? If so, then the issue is likely to have something to do with the modifications you outlined above (such as Karabiner or Vim), or some larger operating system related issue.
If you're not able to replicate the problem in multiple users, it could be related to a problematic preference file. If you open a Finder window and navigate to ~/Library/Preferences, you could try moving the com.apple.HIToolbox.plist to your Desktop, logging out, then logging back in and testing again.
Let us know if either of those suggestions help!

OSX 10.10 Terminal. Help Needed

Dumb question in my terminal I make documents using the touch command. For example:
touch blah.pages
touch blah.numbers
The file was created, but I cant open it.
I'm curious as to why this is. Please help me!
You're probably using Pages and Numbers respectively to open these files, since that's the default.
These programs can't open Pages or Numbers files not created within them, for whatever reason.
You can open the files in another editor though, like nano for example.
Try nano blah.pages and you can edit the empty file.

Resources