Subject: Re: [Vim-vms] Vim on VMS map bug?

From: "Zoltan Arpadffy" <[email-masked]>
Date: Thu, 1 May 2008 08:16:38 +0200

Hello Dan,

Could you please tell me what Vim version and what mode do you use.

… because we have had enormous problems with character reading from the
keyboard especially with esc sequences in console mode.

Today (in the last two years) we use a trick with two sequential reading
with different triggers that does the job without causing IO resource
troubles as earlier.

(see os_vms.c in the Vin source code)

I can imagine that this trick can fail with some special combination of the
qio read terminators. But this is valid just for console mode.

As Motif and GTK executables use standard VMS X11 input I guess that
switching to GUI would solve your problem.

To be honest, I am not very keen to touch that part of the code, because
this sequential read trick is some about the tenth in a row of tried and
failed algorithms.

But if you have a better idea you are very much welcome.

    /* set up the itemlist for the first read */

    vul_item(&itmlst[0], 0, TRM$_MODIFIERS,

         (char *)( TRM$M_TM_NOECHO  | TRM$M_TM_NOEDIT    |

                   TRM$M_TM_NOFILTR | TRM$M_TM_TRMNOECHO |

                   TRM$M_TM_NORECALL) , 0);

    vul_item(&itmlst[1], sizeof(trm_mask), TRM$_TERM, (char *)&trm_mask, 0);

    /* wait forever for a char */

    function = (IO$_READLBLK | IO$M_EXTEND);

    status = sys$qiow(0, iochan, function, &iosb, 0, 0,

                         inbuf, nbytes-1, 0, 0, &itmlst, sizeof(itmlst));

    len = strlen(inbuf); /* how many chars we got? */

    /* read immediately the rest in the IO queue   */

    function = (IO$_READLBLK | IO$M_TIMED | IO$M_ESCAPE | IO$M_NOECHO |
IO$M_NOFILTR);

    status = sys$qiow(0, iochan, function, &iosb, 0, 0,

                         inbuf+len, nbytes-1-len, 0, 0, 0, 0);

Regards,

Z              

  _____  

Från: Dan [mailto:[email-masked]] 
Skickat: den 1 maj 2008 02:46
Till: [email-masked]
Ämne: Vim on VMS map bug?

Hi 

Sorry to bother you but hopefully you may be able to help me.

It might not be so much a bug, but i am trying to map ;; to <Esc> to break
from insert to command mode.

It works on windows, and linux but for the life of me i can't get it working
on the VMS port.

I have tried:

imap ;; <Esc>      
imap ;; ^[      " using ctrl-v  then hitting ESC

amongst others.

Interestingly, i can map <Esc> to the v key (but this is not what i want)

map v ^[

Thanks again !!!!

(p.s) i'm accessing the vms machine using PowerTerm.

Here is my version info.

OpenVMS 8.3 Itanium 64:

VIM - Vi IMproved 7.1 (2007 May 12, compiled Jun 14 2007 14:27:07)
OpenVMS version - IA64
Included patches: 1-2
Compiled by ZAY@TITAN2::TITAN2.SCIGAMES.AT
Big 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 -cursorshape +dialog_con +diff
+digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra
+extra_search +farsi +file_in_path +find_in_path +folding -footer -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 -mzscheme -netbeans_intg -osfiletype +path_extra
-perl +postscript +printer -profile -python +quickfix +reltime +rightleft
-ruby +scrollbind +signs +smartindent -sniff +statusline
-sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl
+tgetent +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: "$VIM/vimrc"
     user vimrc file: "sys$login:.vimrc"
 2nd user vimrc file: "sys$login:_vimrc"
      user exrc file: "sys$login:.exrc"
  2nd user exrc file: "sys$login:_exrc"
Compilation: cc/def=(FEAT_BIG,HAVE_CONFIG_H  )  /opt/prefix=all
/include=([.proto])
Compiler: HP C S7.1-013 on OpenVMS IA64 V8.2-1
Linking: link /exe=vim.exe *.OBJ

---

From: "Zoltan Arpadffy" <[email-masked]>
Date: Sun, 11 May 2008 17:22:22 +0200

Dan,

I am terribly sorry, but this bug is not IA64 specific, but as I told you it
is connected to console mode special esc handling.

I’ll add this to know issues,  but (at least) I do not plan to change this
part of the code in the near future.

It took few months and at least ten different tries before we come up with
the current solution that worked acceptable.

Compaq was also involved but they could not come up with better code either
– or (I guess) they have a better solution, but they have not contributed to
Vim open source porting effort.

I am sorry for bad news.

Regards,

Z

  _____  

Från: Dan [mailto:[email-masked]] 
Skickat: den 2 maj 2008 01:22
Till: Zoltan Arpadffy
Ämne: Re: Vim on VMS map bug?

Just to clarify in my first email, i posted :ver

Thanks again

On Fri, May 2, 2008 at 8:51 AM, Dan <[email-masked]> wrote:

Thanks for the info Zoltan.

I'm using vim in command-line mode. And here is my vimrc:

hi search ctermbg=White
let Tlist_Ctags_Cmd="dev_users:[dan.VIM]CTAGS.EXE"
set ruler
set number
set hlsearch
set nocompatible
set showmode
set incsearch
set showcmd
set ignorecase smartcase
set nowritebackup
set nobackup
set history=1000
set showmatch
set laststatus=2
set tabstop=4
set shiftwidth=4
set expandtab
syntax on
colorscheme vividchalk
filetype plugin on
" rpa files should use pascal syntax highlighting
au BufRead,BufNewFile *.rpa set filetype=pascal
" keep cursor centered when scrolling with k and j
map k kzz
map j jzz
imap ;; <Esc>    " this doesn't work
imap ;; ^[          " neither does this

Another interesting problem i've just found is the permissions are screwed
up.

If i open up the following file in vim, it says it is readonly:

"timetest.c" [readonly] 13L, 157C

But in the "ed" editor i have no problem editing it, and here are its
permissions:

timetest.c;1                1  AHS                   (RWED,RWED,RWED,)

On Thu, May 1, 2008 at 3:46 PM, Zoltan Arpadffy <[email-masked]> wrote:

Hello Dan,

                   TRM$M_TM_NORECALL) , 0);

Regards,

Z              

  _____  

Hi 

I have tried:

imap ;; <Esc>      

amongst others.

map v ^[

Thanks again !!!!

Here is my version info.

OpenVMS 8.3 Itanium 64: