u/9mHoq7ar4Z

Is there a method to get the command entr to adopt the current shells alias'

Is there a method to get the command entr to adopt the current shells alias'

Hi,

Im uncertain how often this is used by other but I regularly use entr. It is basically a program designed to run specified commands when a file is changed

https://github.com/eradman/entr

It works very well except that I wished it picked up my local alias' that I have set.

I was wondering if anyone with a bit more experience knew how to get this to work or if there was an alternative that works better?

Thanks

EDIT - Just FYI, As a workaround I just had entr run a sh script which expanded the alias'

u/9mHoq7ar4Z — 4 days ago

Hi

Im trying to learn the curses library but have come across something that I do not understand.

When I run the code below the stdscr and win update as per expectation. But as soon as you press a key (to get past the stdscr.getkey()) the win object disappears from the screen (even though the win.refresh() method is run)

What I have found is that if I include a win.mvwin() method then the win object will appear just find in the screen.

Im uncertain why this is occuring and was hoping that someone could explain this too me?

import time
import curses
from curses import wrapper

def main(stdscr):
    win = curses.newwin(10,40,10,10)
    win.border()

    # Paint screen and wait for input
    stdscr.refresh()
    win.refresh()
    stdscr.getkey()

    # Paint screen but win does not appear
    stdscr.erase()
    stdscr.refresh()
    # win.mvwin(10,10) # Uncommenting results in win appearing
    win.refresh()

    time.sleep(10)

wrapper(main)
reddit.com
u/9mHoq7ar4Z — 9 days ago

Hi,

I'm learning the curses library but I noticed when looking at the source I don't really understand how it is loaded.

For example I would like to understand where the initscr() method is defined.

I look at the Python curses module documentation page at https://docs.python.org/3/library/curses.html#module-curses . From there it states that the source code is available at https://github.com/python/cpython/tree/3.14/Lib/curses .

When I open the source code link I navigate to the __init__.py file and find that the initscr() method is effectively from a module called _curses.

Can someone help explain to me where this is loaded from?

Thanks

u/9mHoq7ar4Z — 15 days ago