Strange tab-completion behavior with zsh in screen


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Strange tab-completion behavior with zsh in screen
# 1  
Old 11-19-2010
Strange tab-completion behavior with zsh in screen

I'm running Mac OS, using the latest version of zsh.

I've noticed that I have funny tab-completion behavior when inside a screen session.

Specifically, once I press tab, the first part of my command seems to be duplicated before the completion results are inserted.

For example, if I type
Code:
cd ~<TAB>

the contents of my command line will be replaced with
Code:
cd ~cd ~/

Strangely, this superfluous stuff doesn't affect the command: the interpreter still reads the command as
Code:
cd ~/

but it can be confusing at times, and it's certainly annoying to have my computer doing something I didn't intentionally program and cannot figure out.

Any ideas what's up?

Let me know if anybody wants to see any of my rc files.

Thanks all.
# 2  
Old 11-19-2010
Perhaps your TERM variable does not match what is running, so the command line edit features are displaying a mess?
This User Gave Thanks to DGPickett For This Post:
# 3  
Old 11-19-2010
Code:
echo $TERM

returns "xterm-color", which is I believe declared by a setting in the preferences of my Terminal.app.

The same command within a screen session returns "screen".
# 4  
Old 11-19-2010
have you resized your window by any chance?
If so, you might want to run 'resize' from the shell. I don't know where 'resize' lives under MacOS, but on Solaris it's under /usr/openwin/bin directory.
This User Gave Thanks to vgersh99 For This Post:
# 5  
Old 11-19-2010
I ran "locate resize" and it seems the only resize on my computer is part of xterm.

What exactly does it do?

By the way, I noticed that the behavior doesn't occur for every tab-completion request: only when the zsh list of possible matches comes up does this occur.

In cases where there is only one possible match and it doesn't display a list to the user, the command line is unchanged.

Thus I can type
Code:
cd ~<TAB>

and it properly autocompletes "~" to /Users/myusername/, with no doubling. If I press tab again (which returns a list of the contents of ~/), the problem occurs.

Code:
cd~/<TAB>

will cause doubling without having to press tab a second time.
# 6  
Old 11-19-2010
here's the man resize, but I'm not sure if there's one fo MacOS...
This User Gave Thanks to vgersh99 For This Post:
# 7  
Old 11-20-2010
Well, if the screen does not support the control characters defined for xterm-color or screen, the $TERM can create such anomalies. Try other export TERM=model, like xterm-color for screen and vice-versa, or something simpler like vt100, XTERM. I am assuming zsh does something sane on the proper term type. I am not a zsh user yet.
This User Gave Thanks to DGPickett For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing literal tab character from zsh to other program

I have a Zsh script which invokes another program. One of the paramters to be passed, should be a literal tab, i.e what in common programming languages is often written as "\t". If it were bash, I think I could use the special form $"\t" but this doesn't seem to work (the called program... (5 Replies)
Discussion started by: rovf
5 Replies

2. UNIX for Dummies Questions & Answers

Bash Tab Completion Hanging

Hi, I'm having a problem with tab completion at the bash command line. For some reason, whenever I type g<tab>, the terminal will freeze up for 5-10 seconds before asking me if I want to display all 325 possibilities. I thought that maybe it's because of the high number of commands, but I have... (4 Replies)
Discussion started by: Raz716
4 Replies

3. UNIX for Advanced & Expert Users

"╭─ " Character combo in $PATH causes strange autocompletion behavior in zsh

I've posted about this before, but only recently narrowed the problem down to a specific cause. Ok, first of all, the behavior: It occurs when autocompletion brings up its list (not when there is only a single option). Basically, if I were to type, say, cd ~/<TAB> I would get something... (2 Replies)
Discussion started by: marshaul
2 Replies

4. Shell Programming and Scripting

zsh and host completion

Hi there is there a way i can add to my .zshrc so that when i type rsh <tab> it takes the name for a list of hosts i know it looks in .ssh/know_hosts but i want it for rsh and for a list that i supply thanks A (4 Replies)
Discussion started by: ab52
4 Replies

5. UNIX Desktop Questions & Answers

TAB completion in cygwin

Hi there, I ve been using cygwin for some time now without any problems. However, recently I ve mapped a new drive on Windows and are now having problems with TAB completion for awk scripts in cygwin on this newly mapped drive (cygdrive t). I can access and run all files but cygwin doesn't do... (5 Replies)
Discussion started by: Tommes
5 Replies

6. Shell Programming and Scripting

hp unix doesn't have tab completion

hi guys, i am new to HP unix , i am doing Solaris , i am just asking is there any thing like "bash" in hp unix including tab completion? (8 Replies)
Discussion started by: dagigg
8 Replies

7. Shell Programming and Scripting

Tab completion in csh

Is it possible to set up my .cshrc so that a single tab attempts to autocomplete, while a double tab gives a list of all possible options. In other words, I want it to work like bash in this regard. Thanks! (3 Replies)
Discussion started by: James McMurray
3 Replies

8. UNIX for Dummies Questions & Answers

Tab completion gubbins

Hello all How do you configure unix terminal to list files as you tab complete. I'm using a unix terminal at work and when i first started tab complete on a folder would list all matches if there were more than one. eg. monkey.xml mon.xml monkeyboy.xml in one folder if i cd into... (2 Replies)
Discussion started by: GNUless
2 Replies

9. UNIX for Dummies Questions & Answers

Tab Completion on Solaris 10

Hi, Is there a way to turn on tab completetion on Solaris 10? (2 Replies)
Discussion started by: annointed3
2 Replies

10. UNIX for Dummies Questions & Answers

tab completion using ! history command

Hi all, I recently discovered the ! command. I think it's great that !cd ? will match the last command that began with cd ?. However, for ! to be particularly useful to me (for now anyway) it would be nice if there was a tab completion option available (as with the cd command). Does anyone know... (3 Replies)
Discussion started by: x-375HK-x
3 Replies
Login or Register to Ask a Question

Featured Tech Videos