LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-19-2006, 09:16 PM   #1
minike
Member
 
Registered: Aug 2004
Location: Argentina
Distribution: slackware 12
Posts: 211

Rep: Reputation: 30
Question 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.
 
Old 04-19-2006, 11:09 PM   #2
kodon
Member
 
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796

Rep: Reputation: 31
echo -en "\033[?6c"
 
Old 04-20-2006, 12:02 AM   #3
minike
Member
 
Registered: Aug 2004
Location: Argentina
Distribution: slackware 12
Posts: 211

Original Poster
Rep: Reputation: 30
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
 
Old 04-20-2006, 12:16 AM   #4
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
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
 
Old 04-20-2006, 12:46 AM   #5
minike
Member
 
Registered: Aug 2004
Location: Argentina
Distribution: slackware 12
Posts: 211

Original Poster
Rep: Reputation: 30
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)
 
Old 04-20-2006, 12:36 PM   #6
kodon
Member
 
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796

Rep: Reputation: 31
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 12:46 PM.
 
Old 04-20-2006, 02:18 PM   #7
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 34
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.
 
Old 04-20-2006, 05:33 PM   #8
kodon
Member
 
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796

Rep: Reputation: 31
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 06:22 PM.
 
Old 04-20-2006, 10:21 PM   #9
minike
Member
 
Registered: Aug 2004
Location: Argentina
Distribution: slackware 12
Posts: 211

Original Poster
Rep: Reputation: 30
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.
 
Old 04-20-2006, 10:27 PM   #10
kodon
Member
 
Registered: Jul 2004
Location: [jax][fl][usa]
Distribution: Slackware64-current
Posts: 796

Rep: Reputation: 31
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-20-2006 at 11:10 PM.
 
Old 04-22-2006, 03:16 AM   #11
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 34
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 03:51 AM.
 
Old 04-22-2006, 02:44 PM   #12
minike
Member
 
Registered: Aug 2004
Location: Argentina
Distribution: slackware 12
Posts: 211

Original Poster
Rep: Reputation: 30
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
 
Old 04-22-2006, 05:04 PM   #13
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 34
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.
 
Old 04-23-2006, 02:04 AM   #14
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How change text color using linux in text mode only runlevel 3? Xavius Linux - General 7 05-07-2009 02:19 AM
Change the display mode in text mode Drunkalot Linux - General 7 08-12-2005 11:35 AM
Text display not in CO80 mode after 2.6.12 kernel install in runlevel 3? rylan76 Linux - Software 2 07-05-2005 04:43 AM
Booting in text mode versus graphics mode LChalupa Linux - Newbie 3 01-15-2005 07:53 PM
How can I change display mode from character mode to graph mode wuzhong Linux - Hardware 1 08-08-2004 09:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration