Hi, Probably, there is an alias defined in your shell. So when invoke vi from the shell it could be invoking vim. And when you invoke the vi from the system() API it could be invoking vi and not vim.
Check out all the aliases defined on your system (alias command). The other thing that might happen is, vi could be a softlink to vim. So when you invoke vi from the shell, it will instead start the vim session for you. You can find the exact location of the executable being executed by using which command. pra...@prasad-laptop:~/bzr/ftl$ which vi /usr/bin/vi pra...@prasad-laptop:~/bzr/ftl$ ls -L /usr/bin/vi /usr/bin/vi pra...@prasad-laptop:~/bzr/ftl$ ls -l /usr/bin/vi lrwxrwxrwx 1 root root 20 2009-03-04 23:10 /usr/bin/vi -> /etc/alternatives/vi pra...@prasad-laptop:~/bzr/ftl$ ls -l /etc/alternatives/vi lrwxrwxrwx 1 root root 18 2009-03-04 18:32 /etc/alternatives/vi -> /usr/bin/vim.basic pra...@prasad-laptop:~/bzr/ftl$ ls -l /usr/bin/vim.basic -rwxr-xr-x 1 root root 1631012 2009-01-08 07:57 /usr/bin/vim.basic So, on my machine invoking vi starts a vim.basic session. Thanks and Reagrds, Prasad On Wed, May 27, 2009 at 1:19 PM, mthread <rjk...@gmail.com> wrote: > > Hi, > I am trying to run the vi editor from a C application using > 'system' command(ie isystem("vi main.cpp"). The issue is, most of the > keys are not working as it is supposed to be. For example, the arrow > keys and delete key are not working. Event the color scheme associated > with file opened(ie main.cpp) is completely gone and I can only see > the text in plain white color. > Whereas when I open the same file from the shell prompt > everything works fine. Kindly let me know what needs to be done to > solve this issue. > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---