DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Ports and Packages

FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 21st January 2015
jb_daefo jb_daefo is offline
Spam Deminer
 
Join Date: May 2008
Posts: 226
Thanked 5 Times in 5 Posts
Default Shell problem unless running under Xorg

When using Zsh, repeating a command, editing a word or two results in inexact echoing of the cursor, so the result is a misspelled word or something with extra letters, a - apart from the parameter, extra parameters that may make no sense and break the command, etc.

A workaround is to Ctnl-Q it, do an ls, then what is about to be typed is echoed accurately before running it to see if it is what is intended.

Another workaround is to do the commands in a terminal before exiting Xorg, which is easy enough, but not always convenient.

A web search did not give any clue as to any similar problem for anyone else...

Suggestions appreciated...
__________________
FreeBSD 10.1-STABLE
Reply With Quote
  #2   (View Single Post)  
Old 11th February 2015
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,109
Thanked 198 Times in 156 Posts
Default

It's difficult to follow your description, but it sounds to me that you have a "wrong" TERM setting. This can cause artefacts when doing line-editing.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #3   (View Single Post)  
Old 12th February 2015
jb_daefo jb_daefo is offline
Spam Deminer
 
Join Date: May 2008
Posts: 226
Thanked 5 Times in 5 Posts
Default

$TERM is xterm
...................
To describe again:
Code:
# cp -iv filea.txt fileb.txt /mnt
Now, to copy filec.txt just changing one letter, one does not
know:
Code:
cp -iv fileac.txt
cp -iv fileactxt
cp -iv filcatxt ...
What edit results. Because, the cursor shown does not
correspond to its actual editing position within the command line.

Workaround:


One can
Code:
cntl-Q
df
and test if the line about to be run is spelled correctly, since
once the df is shown, the newer command is also shown before it is
run. Slower, works,
but should be corrected...
__________________
FreeBSD 10.1-STABLE
Reply With Quote
  #4   (View Single Post)  
Old 12th February 2015
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,109
Thanked 198 Times in 156 Posts
Default

You can try setting TERM to xterm-color, xterm-xfree86, or screen ... I don't know what the correct one is, since I don't know which terminal emulator you're using.

Here is the relevant section of my tcshrc. I use xterm with tmux.

Code:
# Do the $TERM dance; these options seem to work best on various systems...
if (($?TMUX)) then
    setenv TERM screen
else if ($uname == OpenBSD) then
    setenv TERM xterm-xfree86
else if ($uname == FreeBSD) then
    if ($tty =~ ttyv*) then
        setenv TERM cons25
    else
        setenv TERM xterm-color
    endif
else if ($uname == Linux) then
    setenv TERM xterm-color
else
    setenv TERM vt220
endif
It might also be a problem with the key binds in your shell sending 'wrong' codes...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #5   (View Single Post)  
Old 13th February 2015
jb_daefo jb_daefo is offline
Spam Deminer
 
Join Date: May 2008
Posts: 226
Thanked 5 Times in 5 Posts
Default

Tested zsh with the cons25, no solution. Tested dvtm / screen / tmux (screen helped the most but was altogether a slower solution); then I decided to test putting the relevant zsh aliases (commands and directories) into .bashrc.
That more or less fixed it. If I'm to be doing a copy as in the revised post, I can simply type "bash" and the cursor problem is fixed.

Some days there is a longer series of files to copy in zsh, all at once but not individually, and a set of three commands in that instance, from saved history in zsh, is easier to not have mistakes, as they are not edited [except one whole word sometimes ], but simply rerun again.

Also learned how drop-in replaceable the .bashrc and .zshrc alias syntax is in the use case here.

So 95 percent solved, anyway, as per the original post.
__________________
FreeBSD 10.1-STABLE
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Xorg problem riotnrrd FreeBSD General 0 21st February 2012 04:29 PM
Running a command as a different user w/o starting the login shell Carpetsmoker General software and network 4 1st July 2011 10:33 PM
Problem getting php running badguy OpenBSD General 7 22nd July 2009 03:34 PM
Netbeans running application problem. bsdnewbie999 Programming 4 12th June 2009 10:22 AM
Shell colour problem paul-lkw FreeBSD General 2 30th January 2009 09:55 AM


All times are GMT. The time now is 12:26 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick