LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (http://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   keyboard doesn't work as expected (http://www.linuxquestions.org/questions/solaris-opensolaris-20/keyboard-doesnt-work-as-expected-4175461015/)

hua 05-07-2013 09:13 AM

keyboard doesn't work as expected
 
Hi
I am a experienced Linux user and I am trying to work with Solaris now. I found several problems in my usual routines which I used in Linux previously.
For example in vi editor I cannot use arrow keys to move forward and back, up and down. It prints some characters instead.
I used to scroll the shell when the output of a command is too long with SHIFT+UP SHIFT+DOWN or SHIFT+PAGEUP SHIFT+PAGEDOWN in Linux.
Should it work also in Solaris?
Maybe the problem is related to virtualbox since I am running this Solaris 10 as a virtual-machine.

Can this be solved somehow? Or are there some alternatives for these routines?

pan64 05-07-2013 09:18 AM

yes, you can have macros in vi to simulate the events you need. the solution to scrolling depends on the desktop you use.

hua 05-07-2013 10:23 AM

Actually I don't use desktop its (the Solaris) without GUI. Only shell.
Its a bit better when I connect to it by ssh but still some keys doesn't work. By desktop you mean the guest OS desktop OR the MAIN OS desktop (where virtualbox is installed) which is Win7?

smallpond 05-07-2013 12:41 PM

Basic vi uses control keys for moving around: h, j, k, l. I think the arrow keys are a vim extension.

jlliagre 05-07-2013 01:44 PM

What Solaris release are you running ?

pan64 05-08-2013 01:21 AM

Quote:

Originally Posted by hua (Post 4946619)
Actually I don't use desktop its (the Solaris) without GUI. Only shell.
Its a bit better when I connect to it by ssh but still some keys doesn't work. By desktop you mean the guest OS desktop OR the MAIN OS desktop (where virtualbox is installed) which is Win7?

I mean the solaris desktop, CDE or something newer? But you told you use it without GUI. In this case I would like to know the terminal settings (you need to set it properly) echo $TERM

hua 05-08-2013 02:05 AM

Quote:

Originally Posted by smallpond (Post 4946701)
Basic vi uses control keys for moving around: h, j, k, l. I think the arrow keys are a vim extension.

Sorry I didn't note that the arrow keys doesn't work in EDIT mode (INSERT,INPUT = SHIFT+I). It is very difficult to edit the files with vi without this functionality. For example I have a configuration file which I need to modify so I switch to INSERT mode and try to get to the position where the values should be changed. At the moment I hit the right arrow key the vi turns back to COMMAND mode (or puts some characters instead of movement). The only way to edit the file is to rewrite the complete line with the new value.

I use Solaris 10. I am starting to work in environment with lots of Solaris 10 machines so I need to get comfortable with the Solaris shell. But in my testing environment I have Solaris 11. It is better (it doesn't print characters instead of arrows) but still I cannot navigate in INSERT mode.

How it is supposed to edit an existing config file in Solaris when the arrow keys doesn't work. (I mean if this is a normal behavior of vi in Solaris) Rewriting always the complete line?

I am going to install it in physical hardware to check whether it is not an virtualbox bug with Solaris.

hua 05-08-2013 02:08 AM

Quote:

Originally Posted by pan64 (Post 4947010)
I mean the solaris desktop, CDE or something newer? But you told you use it without GUI. In this case I would like to know the terminal settings (you need to set it properly) echo $TERM

Thanks. Its:
Quote:

echo $TERM
sun-color

jlliagre 05-08-2013 06:31 AM

There is no way to move the cursor in insertion mode under the regular/standard vi, you need to switch to the command mode. What you are used to is a vim extension as smallpond already stated..

It seems you use the I to switch to insert mode.

You should instead just move the cursor using the letter commands (h j k l space backspace/^H) or the arrows while in command mode to the location where you want to insert or modify something and switch to insert mode using either i (insert), a (append), C (change until end of line) or cw (change word).

hua 05-09-2013 09:32 AM

Quote:

Originally Posted by jlliagre (Post 4947133)
You should instead just move the cursor using the letter commands (h j k l space backspace/^H) or the arrows while in command mode to the location where you want to insert or modify something and switch to insert mode using either i (insert), a (append), C (change until end of line) or cw (change word).

This works. It seems I get to used with the extended functionality of vim. I need to accept this different behavior of vi in Solaris.

Thanks

kebabbert 05-16-2013 10:24 AM

Quote:

Originally Posted by hua (Post 4947867)
This works. It seems I get to used with the extended functionality of vim. I need to accept this different behavior of vi in Solaris.

Actually, it is not a "different" behaviour in Solaris, it is the correct original behavior. You are used to a different behavior, and need to adapt to the original behavior now. Anyway, it does not hurt to learn original VI.

hua 05-20-2013 09:16 AM

Quote:

Originally Posted by kebabbert (Post 4952471)
Actually, it is not a "different" behaviour in Solaris, it is the correct original behavior. You are used to a different behavior, and need to adapt to the original behavior now. Anyway, it does not hurt to learn original VI.

Right, I can see it now :)

OctavioPang 06-03-2013 06:35 AM

Yes the same problem occurs with me as well...in my case whenever i press backspace it starts showing # sign instead of deleting the characters. however the up and the down button are working perfectly fine.What is the solution.?..

jlliagre 06-03-2013 08:56 AM

Is "Control-H" deleting the previous character ?


All times are GMT -5. The time now is 05:28 PM.