LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-29-2024, 03:34 AM   #16
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,804

Rep: Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203

On my system the ncurses package also contains toe and the /usr/share/terminfo/r/rxvt* files.


If your system only has the unicode versions.
Maybe you should make sure that your have a utf-8 locale:
Code:
locale
export LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
locale
 
Old Yesterday, 04:52 AM   #17
minuzed
LQ Newbie
 
Registered: Apr 2024
Location: Sweden
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by MadeInGermany View Post
On my system the ncurses package also contains toe and the /usr/share/terminfo/r/rxvt* files.


If your system only has the unicode versions.
Maybe you should make sure that your have a utf-8 locale:
Code:
locale
export LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
locale
Tried that with
Code:
sudo localectl set-locale en_US.UTF-8
but vim is still broken so it made no difference I'm afraid..
 
Old Yesterday, 05:13 AM   #18
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,897

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
after a command like that sudo localectl you may need to log out/log in again.
Anyway, would be nice to compare the two environments (working and non-working vi).

Just one addition:
You can check the environment within vi by executing :%!env and/or :%!set (and save the result)

Last edited by pan64; Yesterday at 05:36 AM.
 
Old Yesterday, 09:04 AM   #19
minuzed
LQ Newbie
 
Registered: Apr 2024
Location: Sweden
Posts: 16

Original Poster
Rep: Reputation: 0
This is what I got from running :%!env as user:
Code:
SHELL=/bin/bash
WINDOWID=12582918
COLORTERM=rxvt-xpm
EDITOR=vi
PWD=/home/user
LOGNAME=user
SYSTEMD_EXEC_PID=492
_=/usr/bin/env
WINDOWPATH=2
HOME=/home/user
ARGS= -br -pn   
LANG=C
VIMRUNTIME=/usr/share/vim/vim91
vblank_mode=0
INVOCATION_ID=62cf483e7bff4e2aa4c698660073cb48
VIM=/usr/share/vim
TERM=rxvt
USER=user
COLORFGBG=default;default
CLUTTER_DISABLE_MIPMAPPED_TEXT=1
DISPLAY=:0
SHLVL=1
SYSTEMD_PAGER=
XDG_RUNTIME_DIR=/tmp/runtime-user
MYVIMRC=/home/user/.vimrc
JOURNAL_STREAM=7:7390
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-A3BSYhSnUE,guid=427c8afa883177b4c6c1b347662b7ba4
XSERVER=/usr/bin/Xorg
And this is what I got from running 'su - root' and then :%!env inside vim:
Code:
SHELL=/bin/sh
COLORTERM=rxvt-xpm
EDITOR=vi
PWD=/root
LOGNAME=root
XDG_SESSION_TYPE=tty
_=/usr/bin/env
HOME=/root
VIMRUNTIME=/usr/share/vim/vim91
VIM=/usr/share/vim
XDG_SESSION_CLASS=user
TERM=rxvt
USER=root
DISPLAY=:0
SHLVL=1
SYSTEMD_PAGER=
XDG_SESSION_ID=c1
XDG_RUNTIME_DIR=/run/user/0
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
MAIL=/var/spool/mail/root
I'm not totally sure what all of those variables do or in what way they might be able to affect vim. At a glance, I don't see anything that looks out of the ordinary.
 
Old Yesterday, 10:09 AM   #20
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,897

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
LANG, TERM and LC_* can be important.
you may try also su root, without -, probably behaves differently
 
Old Today, 02:22 AM   #21
minuzed
LQ Newbie
 
Registered: Apr 2024
Location: Sweden
Posts: 16

Original Poster
Rep: Reputation: 0
Here is the output of running 'su root' and then vim test.txt:
Code:
SHELL=/bin/sh
WINDOWID=29360134
COLORTERM=rxvt-xpm
EDITOR=vi
PWD=/home/user
LOGNAME=root
XDG_SESSION_TYPE=tty
SYSTEMD_EXEC_PID=492
_=/bin/env
WINDOWPATH=2
HOME=/root
ARGS= -br -pn   
LANG=C
VIMRUNTIME=/usr/share/vim/vim91
vblank_mode=0
INVOCATION_ID=62cf483e7bff4e2aa4c698660073cb48
VIM=/usr/share/vim
XDG_SESSION_CLASS=user
TERM=rxvt
USER=root
COLORFGBG=default;default
CLUTTER_DISABLE_MIPMAPPED_TEXT=1
DISPLAY=:0
SHLVL=2
SYSTEMD_PAGER=
XDG_SESSION_ID=c2
XDG_RUNTIME_DIR=/run/user/0
JOURNAL_STREAM=7:7390
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-A3BSYhSnUE,guid=427c8afa883177b4c6c1b347662b7ba4
MAIL=/var/spool/mail/root
XSERVER=/usr/bin/Xorg
I think it look very similar to doing it as a normal user except some mixing of root directories and SHLVL=2 instead of =1.
 
  


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
[SOLVED] Fedora shows 'man vim' but when execute 'vim' got "bash: vim: command not found..." ? flash_os Linux - Newbie 19 01-03-2015 11:56 PM
Switching from vim to vim -g from inside vim iDragoon Linux - Software 4 05-15-2009 11:46 AM
Editor comparison: vim VS vim-lite, Cleaning vim Ruler2112 *BSD 4 04-13-2009 04:26 PM
ls intray/ shows nothing, but sudo ls intray/ gives correct output wilsonsamm Linux - Desktop 3 06-20-2008 02:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

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