christianhaitian / arkos

Another rockchip Operating System
MIT License
1.59k stars 88 forks source link

Missing cursor position in terminal/vim #1087

Closed mdeguzis closed 6 months ago

mdeguzis commented 6 months ago
  1. This is not the Stock OS that comes with your device, AmberElec, JelOS, or UnOfficialOS. ArkOS is a different distribution from those systems and will have differing features. The only somewhat similarity is that they both use EmulationStation as a frontend. Even with that, the versions of EmulationStation that's used in between ArkOS and these other distributions is different with different capabilities. If there are features you prefer with the other available distributions, just use those distributions instead. The choice is yours.

  2. Have you reviewed the Frequently Asked Questions section available for your supported device in the wiki?

  3. If your issue is related to being able to run certain emulators or ports, have you reviewed the Emulators and Ports section available at https://github.com/christianhaitian/arkos/wiki/ArkOS-Emulators-and-Ports-information for needed bios files and supported rom extensions? no

  4. Have you reviewed the known issues section available at https://github.com/christianhaitian/arkos/wiki/Known-issues ? yes

Describe the Issue (If applicable)

Despite setting :set cursorline and :set cursorcolumn, the vertical position won't display. Is this terminal emulator missing a compiled option? I tried different themes and TERM values (linux, xterm, xterm-256color). When SSH is not available, this makes editing files difficult. If this is possible, can you share the VIM setting? I understand a blinking cursor is also usually a function of the terminal itself.

I also have :set ruler on as well. I did try playing with guicursor, and tried what I have on OSX: guicursor=n-v-c:block,o:hor50,i-ci:hor15,r-cr:hor30,sm:block,a:blinkon0.

My current .vimrc:

set cursorline
set cursorcolumn
set number
set ruler

How can the issue be reproduced? (If applicable)

  1. Quip emulationstation
  2. ALT+F2
  3. Edit a file

What version of ArkOS are you on?

May release, 2024

Anything else you'd like to include that may help to review this issue or feature request?

christianhaitian commented 6 months ago

I don't know for vim. I use vi or nano on my end. Have you tried either one of these and see what those do?

mdeguzis commented 6 months ago

Can you post a screenshot of vi with the cursor position shown? I can use nano if it's a weird issue. I figure the vim included may lack some features at build time. No biggie to use nano for quick edits if I can see my cursor position :).

christianhaitian commented 6 months ago

That I don't know. I usually don't use local terminal for much except if i'm in a real bind and have no network connectivity to ArkOS which I never have honestly. Even if I can't boot into emulationstation, I just hold the B button down while booting which takes you to BaRT (Boot and Recovery Tool) and enable Wifi and ssh that way. I wonder if doing printf "\e[?25h" may show the cursor in terminal for you?

mdeguzis commented 6 months ago

Same issue with vi/nano. There is no highlighted line cursor while on the command line either. This is after quitting ES, and switching to TTY2. I'd imagine something in the OS/env. /sys/class/graphics/fbcon/cursor_blink is set to 0, so it should not be that.

I wonder if doing printf "\e[?25h" may show the cursor in terminal for you?

Negative

I'll keep looking for a solution. It's only a problem when I'm on the go and can't use SSH/network. It may seem like a small thing, but useful for those not on network.

christianhaitian commented 6 months ago

Found something interesting here: https://unix.stackexchange.com/a/6898 Maybe worth a shot.

mdeguzis commented 6 months ago

This worked: https://forum.odroid.com/viewtopic.php?t=27897#top

echo -e "\e[?16;0;16c"

It highlights the current letter in bright white. Checking if I can make it a block. Once finalized, would you be ok with adding this to /etc/bashrc or the like?

It seems the device has no hardware cursor. That command enables the software cursor. I also now see the vertical stripe in vi/vim for the column position (set set cursorcolumn). $HOME/.bashrc will work, confirmed it loads that file with a new TTY. The echo above can be placed at the end of ${HOME}/.bashrc and it will load the SW cursor fine.

Here is the sequence that gives a nice blue for highlight amongst the gray/black (2nd param controls color). This results in a blue block on top of the white text.

# Blinking block:
echo -e "\e[?16;0;32c"

# Highlight text position only
echo -e "\e[?16;0;32c"

Colors I sorted out (2nd number)

0 = none
100 = green
1 = some sort of blue

These are all some kind of "style"

See also:

christianhaitian commented 6 months ago

Nice. I'll have to test and make sure that addition doesn't introduce any other oddities to the screen when going in and out of games. I may consider adding this in the future. Thanks for sharing.