Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Secure Shell

Reply
 
Thread Tools Display Modes
  #1  
Old 02-09-2008, 02:33 AM
sinbad sinbad is offline
Registered User
 
Join Date: Feb 2008
Posts: 11
secure crt 6.0 problem

Hi,
I am using secure crt 6.0;i use vi editor; i don't want Vi output to be on the screen when i exit vi;I should see the old contents of the window before vi has started. how to do this. I have tried [un]checking scroll to bottom on output and scroll to clear screen on output options; but still it isn't working. Pls tell me how to do this.

Thanks
sinbad
Reply With Quote
  #2  
Old 02-09-2008, 11:23 AM
MrC MrC is offline
Registered User
 
Join Date: Mar 2004
Posts: 216
This is a function of your terminal setting, the termcap/terminfo database on your system, whether or not the particular entry includes certain terminal initialization sequences, and finally, whether or not your Vim was built with FEAT_XTERM_SAVE.

In vim, type:

Code:
  :help xterm-screens
to read a bit more about it.

To help further, we'll need to know:
  1. the value of $TERM ( echo $TERM )
  2. how your Vim was compiled (enter vim, and type :version<Return> and look for and report any terminfo/termcap entires (mine has -terminfo, meaning Vim was not compiled to use the terminfo libraries and database)
  3. if Vim has the capabilities t_ti and t_te disabled (in Vim, type :set<Return> and look for any t_ti/t_te entries.). I specifically disable mine in my .vimrc, because I do not like the screen swapping.

Start with this, and report back what you find.

MrC
Reply With Quote
  #3  
Old 02-10-2008, 10:59 PM
sinbad sinbad is offline
Registered User
 
Join Date: Feb 2008
Posts: 11
secure crt 6.0 problem

hi,
Thanks for the help. But before scure crt 6.0 , i was using putty to the same telnet host, It works just the way i wanted, like the vi output will be cleared once i exit from vi. so i think vi is fine , i need to configure somethings which u've said earlier, can u explain in little more details what should be done , as now we know that vi is just fine.

thanks
sinbad
Reply With Quote
  #4  
Old 02-10-2008, 11:05 PM
sinbad sinbad is offline
Registered User
 
Join Date: Feb 2008
Posts: 11
secure crt 6.0 problem

Echo $TERM:
xterm

vim version info:

:version
VIM - Vi IMproved 6.3 (2004 June 7, compiled Aug 10 2005 18:47:02)
Included patches: 1-21, 23-24, 26, 28-34, 36-37, 39-40, 42-43, 45-46, 81-82
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Huge version without GUI. Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent -clientserver -clipboard +cmdline_compl +cmdline_hist
+cmdline_info +comments +cryptv +cscope +dialog_con +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi
+file_in_path +find_in_path +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap
+libcall +linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse -mouseshape +mouse_dec +mouse_gpm
-mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang -netbeans_intg -osfiletype +path_extra +perl +postscript
+printer +python +quickfix +rightleft -ruby +scrollbind +signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title -toolbar +user_commands +vertsplit +virtualedit
+visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp -xterm_clipboard
-xterm_save
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/share/vim"
Compilation: i386-redhat-linux-gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -D_GNU_SOURCE -D
_FILE_OFFSET_BITS=64 -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/include/gdbm -I/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE -I/usr/include/python2.3 -pthread
Linking: i386-redhat-linux-gcc -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE -L/usr/local/lib -o vim
-lncurses -lselinux -lacl -lgpm -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE -L/usr/local/lib /usr/lib/per
l5/5.8.5/i386-linux-thread-multi/auto/DynaLoader/DynaLoader.a -L/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE -lperl -lutil -lc
-L/usr/lib/python2.3/config -lpython2.3 -lutil -lm -Xlinker -export-dynamic


set options in vim:

:set
--- Options ---
backspace=2 cscopeverbose helplang=en modified tabstop=4 viminfo='20,"50
cindent expandtab history=50 ruler ttyfast t_Sb=^[[4%dm
cscopetag foldmethod=marker incsearch shiftwidth=2 ttymouse=xterm t_Sf=^[[3%dm
comments=s1:/*,mb:*,elx:*/
cscopeprg=/usr/bin/cscope
fileencodings=utf-8,latin1
Reply With Quote
  #5  
Old 02-11-2008, 12:35 PM
MrC MrC is offline
Registered User
 
Join Date: Mar 2004
Posts: 216
Sinbad,

I don't believe there is any option in SecureCRT to enable/disable the "switch to alternate screen" xterm key sequence, so there must be something else different between your putty and SecureCRT connections.

- Putty supports xterm as the terminal emulator
- Putty as of .54 support the alternate screen switch using xterm
- SecureCRT supports the alternate screen switch using xterm (I just tested, and can make the alternate screen switch, or not, based upon a setting in my .vimrc.)

Given this, this will require you to ensure you are connecting with both terminal emulators using xterm, to the same host, using the same Vim, using the same Vim settings. ( When you are using a X command window, ensure that the titeInhibit resource is not set. )

Here's the way it works in a nutshell:

- you connect to the remote host using a set terminal emulator
- environment variable TERM is set upon login and passed to shell
- invoked programs inherit $TERM; Vim, for instance.
- Vim starts, and calls libraries to obtain and set terminal capabilities for the edit session, based upon $TERM
- Vim performs further initialization via various config files (eg. your .vimrc)
- Vim outputs the terminal initialization sequence, which typically includes "switch to alternate screen".
- The remote terminal emulator receives these ordinary pieces of data and executes the switch

So there is only one possibility here: Vim is *not* outputting the sequence, which implies that something in your putty connection/environment is different from your SecureCRT connection/environment.

Here is something you can do to test:

1) start a typescript be entering "script"
2) start vim and then quit vim
3) type "exit" to exit the typescript

Look inside the file called typescript, for the sequence ^[[?47h and ^[[?47l (thats a lowercase L at the end of the second sequence). Do this for both your putty and SecureCRT connections, and I believe you will find that Vim is not outputting the sequence when you connect via SecureCRT. Please confirm what you find.

FYI: There are a many variations of "xterm" termcap/terminfo entries (see xterm* entries under : /usr/share/terminfo/x, or the appropriate path for you system). Some of those inhibit the screen switch.

Anyway, let's see where this gets you.
Reply With Quote
  #6  
Old 02-11-2008, 01:38 PM
miked's Avatar
miked miked is offline
Registered User
 
Join Date: Feb 2004
Posts: 2,040
MrC - thanks for the excellent information and troubleshooting!

One thing I've observed with PuTTY on some systems is that the TERM variable is set to xterm-colors, or something other than just xterm. Though I'm not sure how or why PuTTY initiates this, it can have an effect on whether or not the screen is cleared (depending on termcap or terminfo settings).

Sinbad, you said that the TERM variable was set to xterm. Is $TERM also set to xterm when you connect using PuTTY?
__________________
Mike
VanDyke Software
Technical Support
[http://www.vandyke.com/support]
Reply With Quote
  #7  
Old 02-11-2008, 02:17 PM
MrC MrC is offline
Registered User
 
Join Date: Mar 2004
Posts: 216
Putty by default always sets the terminal to "xterm". There is a configuration override (Connection->Data, Terminal-type string) which can set xterm-color, or xterm-256color, vt220, etc. Putty passes this string to the server (telnetd, sshd, etc.), which thereby spawns the session login with the appropriate TERM environment variable.
Reply With Quote
  #8  
Old 02-12-2008, 07:38 AM
sinbad sinbad is offline
Registered User
 
Join Date: Feb 2008
Posts: 11
hi MrC, Thanks for your detailed reply , I got to know somethings, I tried the script thing u've told , i couldn't find any of those sequences in typescript file that it has generated; these are the VIM termcap options to the same host.
Tell me how to enable screen switching in vi i will try that.

Putty session:

:set termcap
--- Terminal codes ---
t_AB=^[[4%p1%dm t_cl=^[[H^[[2J t_DL=^[[%p1%dM t_le=^H t_op=^[[39;49m t_sr=^[M t_vs=^[[?12;25h
t_AF=^[[3%p1%dm t_Co=8 t_dl=^[[M t_mb=^[[5m t_RI=^[[%p1%dC t_ts=^[]2; t_xs=
t_AL=^[[%p1%dL t_CS= t_fs=^G t_md=^[[1m t_RV= t_te=^[[?1049l t_ZH=^[[7m
t_al=^[[L t_CV= t_IE=^G t_me=^[[m t_Sb=^[[4%dm t_ti=^[[?1049h t_ZR=^[[m
t_bc= t_ut=y t_IS=^[]1; t_mr=^[[7m t_Sf=^[[3%dm t_ue=^[[m
t_cd=^[[J t_da= t_ke=^[[?1l^[> t_ms=y t_se=^[[27m t_us=^[[4m
t_ce=^[[K t_db= t_ks=^[[?1h^[= t_nd=^[[C t_so=^[[7m t_vi=^[[?25l
t_cm=^[[%i%p1%d;%p2%dH
t_cs=^[[%i%p1%d;%p2%dr
t_vb=^[[?5h$<100/>^[[?5l
t_ve=^[[?12l^[[?25h
t_WP=^[[3;%p1%d;%p2%dt
t_WS=^[[8;%p1%d;%p2%dt
--- Terminal keys ---
t_#2 <S-Home> ^[O2H t_K9 <kMultiply> ^[Oj t_kI <Insert> ^[[2~ <S-F3> ^[[13;2~ <xEnd> ^[OF
t_#4 <S-Left> ^[O2D t_KA <kEnter> ^[OM t_kN <PageDown> ^[[6~ <S-F4> ^[[14;2~ <xHome> ^[OH
t_%1 <Help> ^[[28~ t_k1 <F1> ^[OP t_kP <PageUp> ^[[5~ <S-F5> ^[[15;2~ <S-xF1> ^[O2P
t_%i <S-Right> ^[O2C t_k2 <F2> ^[OQ t_kb <BS> ^H <S-F6> ^[[17;2~ <S-xF2> ^[O2Q
t_&8 <Undo> ^[[26~ t_k3 <F3> ^[OR t_kd <Down> ^[OB <S-F7> ^[[18;2~ <S-xF3> ^[O2R
t_*7 <S-End> ^[O2F t_k4 <F4> ^[OS t_kh <Home> ^[[7~ <S-F8> ^[[19;2~ <S-xF4> ^[O2S
t_@7 <End> ^[[8~ t_k5 <F5> ^[[15~ t_kl <Left> ^[OD <S-F9> ^[[20;2~ <kDel> ^[[3~
t_F1 <F11> ^[[23~ t_k6 <F6> ^[[17~ t_kr <Right> ^[OC <S-F10> ^[[21;2~ <C-Left> ^[O5D
t_F2 <F12> ^[[24~ t_k7 <F7> ^[[18~ t_ku <Up> ^[OA <S-F11> ^[[23;2~ <C-Right> ^[O5C
t_K1 <kHome> ^[[1~ t_k8 <F8> ^[[19~ <Mouse> ^[[M <S-F12> ^[[24;2~ <C-Home> ^[O5H
t_K4 <kEnd> ^[[4~ t_k9 <F9> ^[[20~ <S-Up> ^[O2A <xF1> ^[[11~ <C-End> ^[O5F
t_K6 <kPlus> ^[Ok t_k; <F10> ^[[21~ <S-Down> ^[O2B <xF2> ^[[12~
t_K7 <kMinus> ^[Om t_kB <S-Tab> ^[[Z <S-F1> ^[[11;2~ <xF3> ^[[13~
t_K8 <kDivide> ^[Oo t_kD <Del> ^[[3~ <S-F2> ^[[12;2~ <xF4> ^[[14~


secure crt session:

:set termcap
--- Terminal codes ---
t_AB=^[[4%p1%dm t_Co=8 t_fs=^G t_me=^[[m t_Sf=^[[3%dm t_us=^[[4m
t_AF=^[[3%p1%dm t_CS= t_IE=^G t_mr=^[[7m t_se=^[[27m t_vi=^[[?25l
t_AL=^[[%p1%dL t_CV= t_IS=^[]1; t_ms=y t_so=^[[7m t_vs=^[[?12;25h
t_al=^[[L t_ut=y t_ke=^[[?1l^[> t_nd=^[[C t_sr=^[M t_xs=
t_bc= t_da= t_ks=^[[?1h^[= t_op=^[[39;49m t_ts=^[]2; t_ZH=^[[7m
t_cd=^[[J t_db= t_le=^H t_RI=^[[%p1%dC t_te=^[[?1049l t_ZR=^[[m
t_ce=^[[K t_DL=^[[%p1%dM t_mb=^[[5m t_RV= t_ti=^[[?1049h
t_cl=^[[H^[[2J t_dl=^[[M t_md=^[[1m t_Sb=^[[4%dm t_ue=^[[m
t_cm=^[[%i%p1%d;%p2%dH
t_cs=^[[%i%p1%d;%p2%dr
t_vb=^[[?5h$<100/>^[[?5l
t_ve=^[[?12l^[[?25h
t_WP=^[[3;%p1%d;%p2%dt
t_WS=^[[8;%p1%d;%p2%dt
--- Terminal keys ---
t_#2 <S-Home> ^[O2H t_k2 <F2> ^[OQ t_kl <Left> ^[OD <S-F12> ^[[24;2~
t_#4 <S-Left> ^[O2D t_k3 <F3> ^[OR t_kr <Right> ^[OC <xF1> ^[[11~
t_%1 <Help> ^[[28~ t_k4 <F4> ^[OS t_ku <Up> ^[OA <xF2> ^[[12~
t_%i <S-Right> ^[O2C t_k5 <F5> ^[[15~ <Mouse> ^[[M <xF3> ^[[13~
t_&8 <Undo> ^[[26~ t_k6 <F6> ^[[17~ <S-Up> ^[O2A <xF4> ^[[14~
t_*7 <S-End> ^[O2F t_k7 <F7> ^[[18~ <S-Down> ^[O2B <xEnd> ^[OF
t_@7 <End> ^[[8~ t_k8 <F8> ^[[19~ <S-F1> ^[[11;2~ <xHome> ^[OH
t_F1 <F11> ^[[23~ t_k9 <F9> ^[[20~ <S-F2> ^[[12;2~ <S-xF1> ^[O2P
t_F2 <F12> ^[[24~ t_k; <F10> ^[[21~ <S-F3> ^[[13;2~ <S-xF2> ^[O2Q
t_K1 <kHome> ^[[1~ t_kB <S-Tab> ^[[Z <S-F4> ^[[14;2~ <S-xF3> ^[O2R
t_K4 <kEnd> ^[[4~ t_kD <Del> ^[[3~ <S-F5> ^[[15;2~ <S-xF4> ^[O2S
t_K6 <kPlus> ^[Ok t_kI <Insert> ^[[2~ <S-F6> ^[[17;2~ <kDel> ^[[3~
t_K7 <kMinus> ^[Om t_kN <PageDown> ^[[6~ <S-F7> ^[[18;2~ <C-Left> ^[O5D
t_K8 <kDivide> ^[Oo t_kP <PageUp> ^[[5~ <S-F8> ^[[19;2~ <C-Right> ^[O5C
t_K9 <kMultiply> ^[Oj t_kb <BS> ^H <S-F9> ^[[20;2~ <C-Home> ^[O5H
t_KA <kEnter> ^[OM t_kd <Down> ^[OB <S-F10> ^[[21;2~ <C-End> ^[O5F
t_k1 <F1> ^[OP t_kh <Home> ^[[7~ <S-F11> ^[[23;2~
Reply With Quote
  #9  
Old 02-12-2008, 08:52 AM
MrC MrC is offline
Registered User
 
Join Date: Mar 2004
Posts: 216
These are the values, which appear in both your termcap outputs:

Code:
t_ti=^[[?1049h
t_te=^[[?1049l
and are alternate forms of the earlier escape sequence I indicated:

Code:
t_ti=^[[?47h
t_te=^[[?47l
It appears SecureCRT does not support the 4-digit DECSET sequence to switch to the alternate screen.

You can work around this by placing the following vim startup code in your .vimrc:

Code:
if &term =~ "xterm"
    " SecureCRT does not support 4-digit DECSET
    " let &t_ti = "\<Esc>[?1049h"
    " let &t_te = "\<Esc>[?1049l"
    " Use 2-digit DECSET instead
    let &t_ti = "\<Esc>[?47h"
    let &t_te = "\<Esc>[?47l"
endif
If you ever want to disable the alternate screen, just use:

Code:
set t_ti= t_te=
instead.

FYI: Escape sequence codes refererence for those interested: http://rtfm.etla.org/xterm/ctlseq.html

MrC

Last edited by MrC; 02-12-2008 at 08:57 AM.
Reply With Quote
  #10  
Old 02-12-2008, 11:41 AM
kbarnette kbarnette is offline
VanDyke Technical Support
 
Join Date: Aug 2007
Posts: 587
This is an interesting note MrC.

I have created an entry in our development database database for the issue of SecureCRT failing to handle 4-digit DECSET sequences.

In the event that a resolution is implemented, we will post here.

If there are any who would like to be contacted via e-mail in this event, feel free to contact us and reference this forum thread (2742).

Last edited by jdev; 02-13-2008 at 09:53 AM.
Reply With Quote
  #11  
Old 02-12-2008, 10:37 PM
sinbad sinbad is offline
Registered User
 
Join Date: Feb 2008
Posts: 11
Hurray ! It works, MrC , I owe u a BIG Thanks for your detailed help.
This is interesting issue, I had learnt lot of things while trying to fix this.

Ciao
sinbad
Reply With Quote
  #12  
Old 02-22-2008, 11:18 AM
kbarnette kbarnette is offline
VanDyke Technical Support
 
Join Date: Aug 2007
Posts: 587
Hello,

I am pleased to announce that SecureCRT now handles "1049" DECSET sequences in the xterm emulation.

If you are interested in test this build please send an e-mail to support@vandyke.com with your request. Please set the subject to 'Attn: Kevin Forum Thread 2742'.
Reply With Quote
  #13  
Old 03-06-2008, 08:55 AM
kbarnette kbarnette is offline
VanDyke Technical Support
 
Join Date: Aug 2007
Posts: 587
Hi sinbad,

As referenced in the above post, we have a build of
SecureCRT that we believe handles 1049 DECSET sequences. We
would like you to verify that this build does function as
expected in your environment.

Could you please send an e-mail to support@vandyke.com with
your response to this post letting us know if you would be
willing to test the new build?
As noted previously, please set the subject to
'Attn: Kevin Forum Thread 2742'

Thanks,
~Kevin

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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


All times are GMT -6. The time now is 05:09 AM.