1

I want implement like this at terminal A, open a new terminal B, run command in B, leave B runing, and back to terminal A, run other command.

I have following script, but not what I expected

#!/bin/bash
konsole -e 'sh -c "./tel"'
echo test

The problem is, echo test command won't run, until I close terminal B. terminal A output

"failed to get the current screen resources QXcbConnection: XCB error: 170 (Unknown), sequence: 170, resource id: 90, major code: 146 (Unknown), minor code: 20"

and wait for terminal B close. after I close terminal B, terminal A output "test".

Is there a way to solve the problem?

xian
  • 111
  • konsole -e 'sh -c "./tel"'& add & at the end of first command makes no difference. – xian Dec 14 '18 at 17:55
  • what about running sh -c "./tel && exit" – Pierre-Alain TORET Dec 14 '18 at 18:26
  • Welcome on U&L! I cannot reproduce your issue using konsole 18.08.3, Plasma Desktop 5.14.4, bash 4.4.23. No error here. May you add details about your environment? Are you using some virtual desktop (VNC...)? – fra-san Dec 14 '18 at 19:05
  • my konsole is 16.08.2. SUSE OS could you run konsole -e 'sh -c "ls ; exec bash"' in your terminal, see what happen. mine switch to terminal B, and terminal A is suspended. – xian Dec 14 '18 at 19:24
  • Pierre-Alain TORET, won't work – xian Dec 14 '18 at 19:25
  • Since you asked: running konsole -e 'sh -c "ls; exec bash"' in terminal A: terminal B opens, executes, and stays; terminal A doesn't show a prompt, accepts input, doesn't execute until terminal B is closed. Running konsole -e 'sh -c "ls; exec bash"' & (note the final &) in terminal A: terminal B opens, executes, and stays; terminal A shows a prompt, accepts input, executes without waiting terminal B to be closed. All this is expected. (Continue...) – fra-san Dec 16 '18 at 12:07
  • (... Continued) As it stands, your question is a duplicate because you are not explaining how the linked answer is not working for you. You should edit you answer, or ask a new, clearly different one. Explaining in comments will not work. (Comments (as these from me) are not meant to stay and will likely be deleted). – fra-san Dec 16 '18 at 12:07
  • @fra-san. thanks for reply. I read the "Run a command without making me wait" and tried using &, put terminal B in background. see my first comment. it won't work, make no difference with or with out &. – xian Dec 17 '18 at 16:30

0 Answers0