by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 21:57
    laloch commented #3586
  • 20:54
    khimaros starred xonsh/xonsh
  • 13:32
    bobhy commented #3586
  • 12:51
    bobhy commented #3599
  • 08:47
    qwenger commented #3586
  • 08:07
    anki-code edited #3366
  • 04:16
    keyb0ardninja starred xonsh/xonsh
  • 00:35
    astronouth7303 commented #3599
  • Jun 03 23:00
    bobhy commented #3599
  • Jun 03 18:22
  • Jun 03 18:22
    jamesebastian starred xonsh/xonsh
  • Jun 03 12:56
    jaddison06 commented #3235
  • Jun 03 12:39
    laloch commented #3599
  • Jun 03 07:50
    echcz starred xonsh/xonsh
  • Jun 02 23:44
    bobhy commented #3599
  • Jun 02 23:43
    bobhy commented #3599
  • Jun 02 23:24
    bobhy synchronize #3600
  • Jun 02 17:31
  • Jun 02 12:39
    bobhy commented #3586
matrixbot
@matrixbot
Swedneck (@swedneck:feneas.org) any idea how i'd troubleshoot this?
David Strobach
@laloch
Now confirmed with a freshly created non-root user.
Jamie Bliss
@astronouth7303
xontrib load <name> is just from xontribs.<name> import *, so sys.path and the like
matrixbot
@matrixbot
Swedneck (@swedneck:feneas.org) aha, the xontribs are being installed to /usr/local/lib, which isn't in sys.path
Swedneck (@swedneck:feneas.org) i wonder if this has something to do with me upgrading from fedora 30
Jamie Bliss
@astronouth7303
i'm honestly unsure how pip selects the installation path (and i wrote xpip :P)
David Strobach
@laloch
:))
Jamie Bliss
@astronouth7303
you would think it would select something from sys.path, or the "site" directory
matrixbot
@matrixbot
Swedneck (@swedneck:feneas.org) i guess i should just add the directory to sys.path?
Jamie Bliss
@astronouth7303
yeah, you should be able to do it in your .xonshrc before any xontrib load
matrixbot
@matrixbot
Swedneck (@swedneck:feneas.org) there we go
Swedneck (@swedneck:feneas.org) now it's seeing my xontribs
David Strobach
@laloch
@jbwiv, regarding your question about fixing the xontrib in our index: I'll try to contact the original author and take the PyPI package ownership over from him.
John Wells
@jbwiv
@laloch I’m happy to do so as well. I had planned to update my repo today and submit a PR, but if you want to, feel free. should I assume your fork is already patched?
John Wells
@jbwiv
@laloch after installing your fork, i still get:
$fzf_history_binding = Keys.ControlR
NameError: name 'Keys' is not defined
error running xonsh run control file '/Users/jbwiv/.xonshrc': name 'Keys' is not defined
David Strobach
@laloch
@jbwiv, that's intentional. I do not want to pollute Xonsh namespace by importing Keys. You can use $fzf_history_binding = "c-r" instead.
David Strobach
@laloch
oh, and yes, I'm currently waiting for the original author/maintainer to answer my e-mail.
John Wells
@jbwiv
@laloch ah…k. thanks. I appreciate it!
@laloch works perfectly. thank you
matrixbot
@matrixbot
Swedneck (@swedneck:feneas.org) is there any way to unload xontribs?
David Strobach
@laloch
Well, not officially. You could in theory remove a xontrib in similar way you would unload imported module.
Jamie Bliss
@astronouth7303
the problem is finding all the places a xontrib touched
no, unloading one is not supported, and Here Be Dragons
so, you could remove it from sys.modules but then you'd have to find all the hooks (aliases? events? prompt format fields? ptk hooks? third-party plugin methods?)
matrixbot
@matrixbot
Swedneck (@swedneck:feneas.org) hm, alright
Jamie Bliss
@astronouth7303
if that was a requirement from the beginning, yeah, we could have designed those systems to allow reversal (it's actually a potential problem with events and reload). But retrofitting the feature would be... painful
matrixbot
@matrixbot
Swedneck (@swedneck:feneas.org) is it normal for $UPDATE_PROMPT_ON_KEYPRESS to make the shell unusably slow?
matrixbot
@matrixbot
Swedneck (@swedneck:feneas.org) also, is there any way to periodically update the prompt independent of keypresses?
Swedneck (@swedneck:feneas.org) having the time shown seems rather pointless without updating it..
Gil Forsyth
@gforsyth
Yes, it is always unusably slow. It should probably be stripped out or redesigned to do more efficient redrawing.
There isn't currently a way to update the prompt without a keypress, but prompt_toolkit does support that. We need to re-do how we build the prompt, though
David Strobach
@laloch
I don't think it's worth the effort. Besides, I understand the time displayed in the prompt more as the time when the previous command finished rather than a wall clock. What's the point in having a wall clock in your prompt anyway? Looking around myself right now, I can see five devices displaying the current time. Every idling gadget has a semi-useful clock display somewhere on itself.
Gil Forsyth
@gforsyth
I care much less about the time -- but event-driven redrawing would be helpful
insert vs command mode using vim bindings, e.g.
David Strobach
@laloch
ok, you're right. The input mode indicator is a relevant argument.
Jamie Bliss
@astronouth7303
input mode, git indicators, infra status (I have had configurations where i pulled status info from salt and fed it to my right-hand-side)
David Strobach
@laloch
do those really need to be refreshed dynamically?
Jamie Bliss
@astronouth7303
on event would be nice
like, if you do stuff and click back to your terminal and the prompt shows the current status
David Strobach
@laloch
I don't really like the idea of all my console windows blinking like a christmas tree.
Jamie Bliss
@astronouth7303
how much they blink depends on what's on your prompt and how often that info changes :P
like, i don't think your git repo status changes often enough to be described as a christmas tree (and any git event source should wait a moment for the repo to settle anyways)
Raphael Das Gupta
@das-g

In other news, xonsh got a mention in https://pypi.org/project/nixpkgs/

Huh, interesting. Gotta look into that.

(On my private computer I'm now using NixOS with Xonsh as my account's login shell. On my work computer, I'm still using NixOS with the default shell (Bash).)

matrixbot
@matrixbot
Swedneck (@swedneck:feneas.org) oh yeah i didn't think about the time showing when the previous command ended
Swedneck (@swedneck:feneas.org) as for why having the current time in the terminal: i just like making some use of empty space :P
matrixbot
@matrixbot
Swedneck (@swedneck:feneas.org) i seem to be unable to import functions from .xsh files even though i added '' to sys.path, any ideas what might be going wrong?
David Strobach
@laloch
I know, this is not an answer, but:
$ echo """
. def bar():
.     print("foobar")
. """ > foo.xsh
.
$ import foo
$ foo.bar()
foobar
David Strobach
@laloch
what's the error message, btw?
David Strobach
@laloch
if it cannot find the file to be imported and you want to get your hands dirty, you could place some debug prints into find_spec method at https://github.com/xonsh/xonsh/blob/552338b324119618373f38323a917a3017b0906e/xonsh/imphooks.py#L73