Git Product home page Git Product logo

Comments (19)

justinmk avatar justinmk commented on May 18, 2024 1

But internally there's no reason for codi.vim to use fish (or whatever the default 'shell' is). It can just call /bin/bash or env bash or whatever, with jobstart(['env', 'bash', ...]). (Doesn't require modifying user's 'shell'.)

from codi.vim.

metakirby5 avatar metakirby5 commented on May 18, 2024

This is almost definitely caused by #61. Can you see if reverting 25d4742 fixes it on your end?

from codi.vim.

justinmk avatar justinmk commented on May 18, 2024

Well, shellescape shouldn't be used with writefile(). writefile() isn't using a shell...

from codi.vim.

justinmk avatar justinmk commented on May 18, 2024

Could be related to fish. Similar problem was reported here: justinmk/vim-dirvish#73

@decent1 If you change your shell to bash (including 'shellcmdflag' and all other shell-related options), does it help?

from codi.vim.

metakirby5 avatar metakirby5 commented on May 18, 2024

@justinmk, @cympfh had an issue where their version of script couldn't find the python command ($PATH issues maybe?).

EDIT: I see what you mean, oops. I'll try that out.

from codi.vim.

metakirby5 avatar metakirby5 commented on May 18, 2024

Actually, shellescape() should still probably used since the arguments to the interpreter (python, etc.) still need to be "shell-escaped."

from codi.vim.

metakirby5 avatar metakirby5 commented on May 18, 2024

(Should add... a lot of these problems are caused by relying on the external script executable, which differs in implementation across platforms. Have been planning a rewrite using Python's pty capabilities which should eliminate platform differences, but school's got me busy.)

from codi.vim.

akifd avatar akifd commented on May 18, 2024

Ok, so first I tried reverting the 25d4742 commit and that didn't help.

While leaving the commit reverted, I changed my default shell back to bash with chsh -s /bin/bash and relogged (:echo $SHELL outputted /bin/bash), but that didn't help either. Log said the same thing:

[10:25:20.554876] <SNR>131_codi_handle_data[9]: [DATA] bash: /tmp/cmd: Permission denied

Then I tried chmod 777 /tmp/cmd and Codi started working again! For some reason it doesn't work anymore with fish. (I'll soon try again with fish as I really want to use it instead of bash). I hard resetted the revert and as it didn't seem to have an effect one way or the other.

But is that permission denied thing a bug? I tried deleting /tmp/cmd and Codi just recreated it with -rw-rw-r-- permissions, which gives the permission denied.

EDIT: Tried again with fish, with and without the 25d4742, but no luck. I also updated my vim to 8.0.339 and that didn't help either.

from codi.vim.

metakirby5 avatar metakirby5 commented on May 18, 2024

Sorry I haven't commented on this issue in awhile. @decent1, would you mind pinning down the exact commit in which things broke?

from codi.vim.

akifd avatar akifd commented on May 18, 2024

@metakirby5 it seems to be commit 9a570ec. If I reset to one commit before it, Codi works again.

from codi.vim.

metakirby5 avatar metakirby5 commented on May 18, 2024

Ah ok, so it was that commit. I got the chronological ordering of the commits wrong so I thought that reverting 25d4742 would also revert 9a570ec. Mind posting your script version info?

from codi.vim.

akifd avatar akifd commented on May 18, 2024

script from util-linux 2.27.1

from codi.vim.

mdsn avatar mdsn commented on May 18, 2024

Same issue here. Content of /tmp/cmd is 'python', and from the log:

[19:48:28.281643] <SNR>50_codi_handle_data[9]: [DATA] zsh:1: permission denied: /tmp/cmd

After doing chmod u+x /tmp/cmd codi starts responding. Not sure why it needs the file to be executable though.

from codi.vim.

gbrlsnchs avatar gbrlsnchs commented on May 18, 2024

My solution was to create the function below:

function s:AllowCodi()
   if empty(glob('/tmp/cmd'))
       call system('touch /tmp/cmd')
   endif

   call system('chmod u+x /tmp/cmd')
endfunction

And then I called it on VimEnter:

autocmd VimEnter * call s:AllowCodi()

from codi.vim.

mpeterson avatar mpeterson commented on May 18, 2024

Had the same problem, this solution fixed it but should probably be included into the plugin.

Here is with Fedora 26 with script from util-linux 2.30

from codi.vim.

metakirby5 avatar metakirby5 commented on May 18, 2024

Sorry for the delay. I've added a setfperm call at 93cfc91. Please check out the cmd-perm branch and see if it fixes the issue. I can't test Linux at the moment, but I would like to confirm that it works before merging it.

from codi.vim.

akifd avatar akifd commented on May 18, 2024

Tried with cmd-perm branch and I don't get the permission error now. But I still don't get any output, at least with Fish shell. The log just says:

[09:49:29.840972] <SNR>154_user_au[1]: Doing autocommand CodiUpdatePre
[09:49:29.841350] <SNR>154_codi_do_update[29]: Starting job for buffer 1
[09:49:29.843900] <SNR>154_stop_job_for_buf[8]: Stopping job for buffer 1
[09:49:29.844653] <SNR>154_codi_do_update[65]: [INPUT] 5 + 5^@^M^D^D^M
[09:49:29.845605] <SNR>154_codi_do_update[66]: Expecting 2 prompts
[09:49:29.852668] <SNR>154_codi_handle_data[9]: [DATA] 5 + 5
[09:49:29.853246] <SNR>154_codi_handle_data[9]: [DATA] Session terminated.

But, if I checkout to commit e2aa007, Codi starts working again.

from codi.vim.

metakirby5 avatar metakirby5 commented on May 18, 2024

@decent1 Sorry, I had forgotten about the fish issue. What happens if you run /tmp/cmd directly from your shell?

from codi.vim.

akifd avatar akifd commented on May 18, 2024
~ ยป /tmp/cmd
Failed to execute process '/tmp/cmd'. Reason:
exec: Exec format error
The file '/tmp/cmd' is marked as an executable but could not be run by the operating system.

I'm noob with linux, so I don't know if this helps, but fish says this when the beginning of the file is missing shebang and it won't know what to do with the contents.

from codi.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.