Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-19-2006, 10:16 PM
|
#1
|
Member
Registered: Aug 2004
Location: Argentina
Distribution: slackware 12
Posts: 211
Rep:
|
square cursor in text-mode display (no X)?
so long..
yeps, it's a trivial issue but, wanna get it the way I like
the story: every time I (re)install slack, I select the 800x600 fb display mode for the console, and I get a (beautiful) square blinking cursor.. but then I install the pre-compiled 2.6.x kernel, and such cursor is replaced by the typical underscore-style cursor (this: _ ). The fb display mode remains the same, but the square cursor is gone.
The question: what should I do to get such square cursor back?
thanx in advance.
|
|
|
04-20-2006, 12:09 AM
|
#2
|
Member
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796
Rep:
|
echo -en "\033[?6c"
|
|
|
04-20-2006, 01:02 AM
|
#3
|
Member
Registered: Aug 2004
Location: Argentina
Distribution: slackware 12
Posts: 211
Original Poster
Rep:
|
thanks, kodon ..
do U know how to set it as default? --when I change it thru such string, and then I open vim, after closing it the underscore cursor is back
|
|
|
04-20-2006, 01:16 AM
|
#4
|
Senior Member
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Rep:
|
You should be able to add that command to /etc/profile or ~/.bash_profile and have it be persistent. Full screen apps may take that away, but they always mess with the framebuffer anyway.
-- Shade
|
|
|
04-20-2006, 01:46 AM
|
#5
|
Member
Registered: Aug 2004
Location: Argentina
Distribution: slackware 12
Posts: 211
Original Poster
Rep:
|
Quote:
Originally Posted by Shade
You should be able to add that command to /etc/profile or ~/.bash_profile and have it be persistent. Full screen apps may take that away, but they always mess with the framebuffer anyway.
-- Shade
|
how to do that 'persistent' thing?
(my idea was to add the command in rc.local)
|
|
|
04-20-2006, 01:36 PM
|
#6
|
Member
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796
Rep:
|
hmm.
afaik, i believe you would need to edit and recompile
a terminfo page to set it as the system "default"...
although i'm not positive and have never felt the
need to go about attempting this.
alternatively, you might be able to hack the kernel source
Last edited by kodon; 04-20-2006 at 01:46 PM.
|
|
|
04-20-2006, 03:18 PM
|
#7
|
Member
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536
Rep:
|
As kodon said: echo -en "\033[?6c"
If some apps reset the cursor, just create a shell function in your shell rc file, e.g.
Code:
set_cursor()
{
echo -en "\033[?6c
}
and run it whenever an app changes the cursor. What's the problem?
There's no need to hack the kernel, which wouldn't help anyway, unless you disable the ability to change it altogether, since vim etc would still be able to frob it.
Quote:
my idea was to add the command in rc.local
|
rc.local has nothing to do with your shell.
|
|
|
04-20-2006, 06:33 PM
|
#8
|
Member
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796
Rep:
|
or put
PROMPT_COMMAND="echo -en '\033[?6c'"
in your /etc/profile or ~/.bash_profile
...or put it right into your PS1
Last edited by kodon; 04-20-2006 at 07:22 PM.
|
|
|
04-20-2006, 11:21 PM
|
#9
|
Member
Registered: Aug 2004
Location: Argentina
Distribution: slackware 12
Posts: 211
Original Poster
Rep:
|
well, It seems the way to set it as default is re-compiling the kernel, but it's not important enough to do such thing just for the cursor..
I've tryied setting it at runlevel 3 using the echo command -in fact that's how I have it right now, but my principal wish is to have it as default, avoiding that any app. change it back to the underscore-style.
So, if some day I need to re-compile the kernel because of more 'relevant' reasons, I'm gonna do the job then.
thanks to all.
|
|
|
04-20-2006, 11:27 PM
|
#10
|
Member
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796
Rep:
|
that's pretty much what i was saying earlier...
but either the PROMPT_COMMAND or including the
ascii escape code in your PS1 *should* get close
to the functionality you want, even if the actual
system default is still the underscore.
ie: when exiting vim the term reloads the font and sets cnorm,
your bash prompt would immediately reset it back.
Last edited by kodon; 04-21-2006 at 12:10 AM.
|
|
|
04-22-2006, 04:16 AM
|
#11
|
Member
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536
Rep:
|
Quote:
or put
PROMPT_COMMAND="echo -en '\033[?6c'"
in your /etc/profile or ~/.bash_profile
|
Uh, yeah, that would be easier. The reason I do it manually is because my cursor gets munged only rarely so I don't feel the need to reset it at every prompt. But in this case, that would probably be better.
As for this ridiculous suggestion of patching the kernel, that's the stupidest thing I've every heard. The kernel does not set the default cursor (unless you're using the framebuffer+softcursor for those fb's that support it). The default cursor is hard-coded into every VGA BIOS that's ever been made. Sure, the kernel could set the cursor at boot time, but that is effectively no different to running the echo command above. It is pointless hacking the kernel to do something that can be done trivially from the command line.
And even if you did, so what? Vim and co could still change the cursor back again, unless you disable the ability to change the cursor altogether. And you can't do that blindly, because it is still sometimes appropriate to turn the cursor off (e.g. dialogs/installers etc), so you'd have to catch that situation. No, let's use a little common sense people. Put the echo command in your prompt or a function, depending on how regularly you need to run it.
Last edited by ioerror; 04-22-2006 at 04:51 AM.
|
|
|
04-22-2006, 03:44 PM
|
#12
|
Member
Registered: Aug 2004
Location: Argentina
Distribution: slackware 12
Posts: 211
Original Poster
Rep:
|
Quote:
Originally Posted by ioerror
As for this ridiculous suggestion of patching the kernel, that's the stupidest thing I've every heard. The kernel does not set the default cursor (unless you're using the framebuffer+softcursor for those fb's that support it)
|
wowowow.. easy, boy.. that souds agressive..
..as I said in the first post, my system setting is in fb (frame-buffer) 800x600 mode.. under this situation, the cursor selected by the kernel becomes the default one, so it do make difference from setting it thru the command-line than having it patched in the kernel.
Quote:
Vim and co could still change the cursor back again
|
yes...to the default one. (that's all about)
in spite of this, I agree with U in one point: won't recompile the kernel just for this trivial issue..
..well .. not shure.
cheers
|
|
|
04-22-2006, 06:04 PM
|
#13
|
Member
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536
Rep:
|
Quote:
wowowow.. easy, boy.. that souds agressive..
|
Uh, sorry, didn't mean to sound OTT, it just seems like a rather silly suggestion.
Quote:
..as I said in the first post, my system setting is in fb (frame-buffer) 800x600 mode.. under this situation, the cursor selected by the kernel becomes the default one, so it do make difference from setting it thru the command-line than having it patched in the kernel.
|
Quote:
yes...to the default one. (that's all about)
|
Well, not really. The default cursor is only that, the default. Any app can change the cursor to whatever it wants, so you still need to able to set it from the command line, which makes patching the kernel rather redundant.
|
|
|
04-23-2006, 03:04 AM
|
#14
|
Senior Member
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247
Rep:
|
In modern VGA bios there are both _ and square one. Each has its own code, that's why changing the code in console mappings should change the cursor.
|
|
|
All times are GMT -5. The time now is 03:41 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|