Home   Archive   Permalink



Windows/Macintosh/Linux differences

I am making a little demo project that I am trying make run as identically as possible on Windows, Mac, and Linux, to show that it can be done.    
    
I put the whole thing in one folder. At the root level of that folder I have the executable interpreters, renamed as “rebol-windows.exe,” “rebol-macintosh,” and “rebol-linux.” To run the application in a way that seems to be the most “identical” for all platforms, I use Windows Explorer or else “cd” to the folder with a command prompt, then run the appropriate executable (double-click the Windows version, “./rebol-macintosh” for Mac, and “./rebol-linux” for Linux). When the REBOL desktop comes up, I click the “Console” button to get the command prompt, and then type “do %RPE.r” to run my program. All that works reasonably well.
    
The program RPE.r is a little programming environment, and while I try to do everything in REBOL to show it can be done, I thought it might be a nice touch to have a button to launch the vim editor which I like as much as vim can be liked. I put in three buttons, one for vim on each of the three platforms. The way each button works is to call another REBOL program with the “launch” function (because “launch” should work on all platforms) and have the launched program “call” the vim editor with the appropriate path for each platform. The reasoning for launching the sub-program and having the sub-program do the calling was that it would prevent the RPE.r program from crashing if anything went wrong farther “downstream” so to speak. I have the paths to vim coded like this:
    
CONFIG-VIM-WINDOWS: 'C:\Program Files (x86)\Vim\vim73\gvim.exe'
CONFIG-VIM-MACINTOSH: '/usr/bin/vim'
CONFIG-VIM-LINUX: '/usr/bin/vim'
    
And I call them like this:
    
call CONFIG-VIM-WINDOWS    
call CONFIG-VIM-MACINTOSH
call CONFIG-VIM-LINUX
    
Depending on which button is clicked.
    
On Windows, this scheme works. On Mac and Linux, it does not, and I am not quite sure what is going on, if this even can be done, what I might do differently, etc. What happens is that I run a terminal program in order to run REBOL, and then when the REBOL desktop appears and I click the “Console” button, the REBOL command prompt appears in that same terminal window. Then I enter “do %RPE.r” to run my own program, and when I click the button to run the vim editor, the vim editor also appears in that same terminal window.    
    
At that point, if I try to type something in what appears to be the vim window, nothing appears, or maybe something does, or maybe part of what I type does, or I might get a vim error message, or maybe a REBOL message and a REBOL prompt; it’s just a mess. It’s like the REBOL console and vim are sharing the same window and getting in each other’s way.    
    
So I am wondering if anyone has any ideas, primarily if this even can be done, and secondarily how I might do it (since I suspect it can’t be done).
    
Thank you.


posted by:   Steven White     12-Jan-2016/12:31:47-8:00



That long write-up got me thinking, and I have solved half my problem.
    
In explaining my attempts to run vim on three platforms, I realized that I was not actually doing the same thing on three platforms. On Windows, I was running gvim, the graphical version, and on Mac and Linux I was running vim, the console version. So, on my test Linux computer, I installed gvim and adjusted the "call" function in my REBOL program to call gvim instead of vim, and now I get gvim in its own window, so my alleged conflicts in the terminal window no longer happen.    
    
So the problem still exists, but has been reduced to running some form of vim on the Macintosh. The approach I am pursuing now is to see if anyone has compiled gvim for Mac.
    
Thank you.

posted by:   Steven White     12-Jan-2016/13:55:06-8:00