0

I want to write a customize program in libtmux, that takes input of session name, stop that session and then restart it.

def new_function(session):

    import libtmux
    server = libtmux.Server()
    session= input('Enter Session Name:')
    print (session)
    my_session = server.find_where({"session_name": session})

    server.attach_session(target_session=my_session)


if __name__ == '__main__':
    print '............'

    new_function(session)

It displays the session that are already created, take input but does not find that session. Is there any way to find the session via variable like this ?

server.find_where({"session_name": session})

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.