Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xterm not pre-installed on Mac #15

Closed
kritixilithos opened this issue Feb 9, 2017 · 4 comments
Closed

Xterm not pre-installed on Mac #15

kritixilithos opened this issue Feb 9, 2017 · 4 comments
Labels

Comments

@kritixilithos
Copy link
Collaborator

os_code.py opens xterm to run V programs in debug mode for both Linux and Mac. However, in macs xterm by default is an unknown command since it is not pre-installed.

elif args["platform"] == "Linux":
command = "xterm -e 'nvim -n -i NONE -u nvim/init.vim "

All I'm suggesting is that there be a statement to check if the platform is macOS and then runs the program without calling xterm

@DJMcMayhem DJMcMayhem added the bug label Feb 9, 2017
@DJMcMayhem
Copy link
Owner

That's a great point. Right now I'm just pretending that mac and linux are identical since most of the commands are close enough. https://github.com/DJMcMayhem/V/blob/master/main.py#L35

I'll distinguish the two, but I don't have a mac for testing on. Do you know what command I can use to open nvim in a new terminal window rather than the current one? The reason I used xterm -e 'nvim ...' is so that a new window would open and the process would fork. I'm not sure how to do that on OS X.

@kritixilithos
Copy link
Collaborator Author

kritixilithos commented Feb 11, 2017

With help from an SO answer, I was able to try something to fix it. Hence, I created a pull request after trying out everything to see if they worked, and they did! But I'm not entirely sure if what I did is the best way of solving this issue because the process doesn't really fork...

It should be noted that the new window will always (unless you modify the default settings) be the standard Terminal window. So even if you are running from another terminal (like XQuartz or iTerm2), it will still open a Terminal window when running nvim. (Also if you are using XQuartz like I am, the xterm command will also work)

@kritixilithos
Copy link
Collaborator Author

Thinking about it now, there is an alternative that would not require any change in the code, but would require another dependency for the users, XQuartz (used to be called X11 on older macs, but doesn't exist on newer macs). With XQuartz, the xterm command will run just fine without any problems. Not just that, the command key (as per my experience) will now emulate the behaviour of the alt key on windows and linux (for example, on the standard Terminal, alt+o = ø, but on XQuartz, Cmd+o = ï). This would make it easier for V-golfing.

@DJMcMayhem
Copy link
Owner

Closed in aced470

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants