I use byzanz-record to record gif.
so I use this command to record a 10 second gif
let g:wsd = job_start(['byzanz-record', '-d', 10, '-x', 0, '-y', 0, '-w', 1366, '-y', 743, '/home/wsdjeg/Pictures/testvim.gif'])
my screen is 1366 * 768, so I want to recort my workspace without i3-status ( 1366 * 743 )
in neovim, it works well ( using jobstart()
), but in vim8 it only record the half of my i3-status
the gif generate in vim8 is:
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
This is my script for record gif
let s:record_window_x = 0
let s:record_window_y = 0
let s:record_window_w = 1366
let s:record_window_h = 743
let s:record_id = 0
let s:record_file = ''
function! s:start_record() abort
let s:cmd = ['byzanz-record', '-d', 40, '-x', s:record_window_x, '-y', s:record_window_y, '-w', s:record_window_w, '-h', s:record_window_h]
redraw!
let time = strftime('%Y-%m-%d-%H-%M-%S')
let fname = [expand('~/Pictures/') . time . '.gif']
let s:record_file = 'file://' . fname[0]
let s:record_id = s:JOB.start(s:cmd + fname, {'on_exit' : funcref('s:record_exit')})
endfunction
let g:wsd = job_start(['byzanz-record', '-d', 10, '-x', 0, '-y', 0, '-w', 1366, '-y', 743, '/home/wsdjeg/Pictures/testvim.gif'])
Are you sure that the string just left to the number 743 is '-y'
? I don't know about byzanz at all, but I guess most people tend to use '-h'
instead of '-y'
when they have a commma-seprated list like that shown above, guessing they are something about coordinates.
oh, yeah,that is a mistake. but you check the script I show in first comment. even if use right argv -x 0 -y 0 -w 1366 -h 743
when using vim8 job, the record aero is wrong.
oh, yeah,that is a mistake. but you check the script I show in first comment.
Where is "the script I show in first comment"? Are you referring to a snippet of Vim script in your second comment? Then, in that snippet, we have
let s:record_id = s:JOB.start(s:cmd + fname, {'on_exit' : funcref('s:record_exit')})
Where is the definition JOB
? With such an incomplete script, how did you verify your claim that "even if use right argv -x 0 -y 0 -w 1366 -h 743 when using vim8 job, the record aero is wrong" with Vim at work?
The script works well with -h 743 on ms windows. What OS are you using?
@nuko8 here is my test step:
run:
let g:wsd = jobstart(['byzanz-record', '-d', 10, '-x', 0, '-y', 0, '-w', 1366, '-h', 743, '/home/wsdjeg/Pictures/testneovim.gif'])
I get:
in vim8:
run:
call job_start(['byzanz-record', '-d', 10, '-x', 0, '-y', 0, '-w', 1366, '-h', 743, '/home/wsdjeg/Pictures/testvim.gif'])
I get:
my os is archlinux, and I am using i3-wm
isn't that a problem of byzanz then, since the parameters are the same?
BTW, did you check with a different WM, terminal or Operating system?
@chrisbra the parameter are same when I run it in vim and neovim. BTW, I have check it in gvim, it is same as vim8. I can not test it in other os/wm now. I think I can do it in the next weekend. I am so sorry.
EDIT: I think it is a bug about how vim8 detect the topleft position of the whole screen.
It is true that any X client is allowed to request its startup position to the X11 server, but usually, by an established convention, window managers are permitted to intercept such a request and examine whether or not the one is acceptable in view of their resource management policy; if it is acceptable, window managers forward it to the server as it is; otherwise, they modify it so that it will fit the policy, and then the modified one is sent to the server. The client will be notified of the moderation later and is supposed to live with it.
Also, remember that Vim is not an X client itself; it's virtual terminal emulators that primarily communicate with the window manager. As to what is seen as if Vim behaved like an X client (e.g., its changing the contents of the title bar of the terminal), Vim owes it to terminal's functionality (Rigorously speaking, I should talk about the selection mechanism; in view of that, Vim is surely an X client. But I don't want to talk about it further in order to keep our focus on the issue itself.)
Accordingly, for the cases like this issue, what should be investigated first is either the window manager or the terminal in use. IOW, common sense tells us Vim is the last suspect of the case.
I suspect those are the primary reasons most people have been incredulous to your claim. Accordingly, your further effort to address them could help us convince it.
I can not test it in other os/wm now.
Any standard X11 should have twm
.