Code Monkey home page Code Monkey logo

Comments (4)

pqn avatar pqn commented on July 21, 2024 1

@toofar thanks for looking into this. Happy to accept this as a PR if you'd like to create one, otherwise we'll likely make this change ourselves then.

from codeium.vim.

pqn avatar pqn commented on July 21, 2024

@fortenforge I can also reproduce this on macOS but not Ubuntu

from codeium.vim.

toofar avatar toofar commented on July 21, 2024

I can reproduce this (long line of control characters printed over the buffer as pictured in #126) with wezterm and vim 9.0 (patches 1-1658). On the same system using urxvt it only puts a couple of characters there instead of a huge list.

I did the old "follow the logic flow and comment out functionality until the symptoms change" trick and traced it to these two system() calls: https://github.com/Exafunction/codeium.vim/blob/7e0054a/autoload/codeium/server.vim#L123-L124

Removing the substitute and using echom on the raw string returned from system() it looks like the "garbage" on the screen is control characters that are read after the end of the output from uname. Interestingly, when I comment out the call to StartLanguageServer that is triggering that code path the garbage doesn't show up when I later call CodeiumEnable, so possibly it's something that only happens when system() is called while vim is starting up before it's initialized the terminal fully.

Anyway, :help system says to prepend the calls with silent when you don't need user input because it "avoids stray characters showing up on the screen", and that seems to resolve the issue here just fine:

diff --git i/autoload/codeium/server.vim w/autoload/codeium/server.vim
index 569c4abf5171..9cd65ea9fa73 100644
--- i/autoload/codeium/server.vim
+++ w/autoload/codeium/server.vim
@@ -120,8 +120,8 @@ function! s:SendHeartbeat(timer) abort
 endfunction

 function! codeium#server#Start(...) abort
-  let os = substitute(system('uname'), '\n', '', '')
-  let arch = substitute(system('uname -m'), '\n', '', '')
+  silent let os = substitute(system('uname'), '\n', '', '')
+  silent let arch = substitute(system('uname -m'), '\n', '', '')
   let is_arm = stridx(arch, 'arm') == 0 || stridx(arch, 'aarch64') == 0

   if os ==# 'Linux' && is_arm

from codeium.vim.

fortenforge avatar fortenforge commented on July 21, 2024

Wow really good find

from codeium.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.