Shell Prompt Seemingly Does Not Reappear After Running a Script That Uses Exec with Tee to Send Stdout Output to Both the Terminal and a File

shell prompt seemingly does not reappear after running a script that uses exec with tee to send stdout output to both the terminal and a file

First, when I'm testing this, there always is a new shell prompt, it's just that sometimes the string output comes after it, so the prompt isn't last. Did you happen to overlook it? If so, there seems to be a race where the shell prints the prompt before the tee in the background completes.

Unfortunately, that cannot fixed by waiting in the shell for tee, see this question on unix.stackexchange. Fragile workarounds aside, the easiest way to solve this that I see is to put your whole script inside a list:

{
your-code-here
} | tee logfile

Bash read/write file descriptors -- seek to start of file

No. bash does not have any concept of "seeking" with its redirection. It reads/writes (mostly) from beginning to end in one long stream.

How can I clear the terminal in Visual Studio Code?

Use Ctrl+K. This goes clean your console in Visual Studio Code.

Per comments, in later versions of VSCode (1.29 and above) this shortcut is missing / needs to be created manually.

  • Navigate: File > Preferences > Keyboard Shortcuts
  • search for workbench.action.terminal.clear
  • If it has no mapping or you wish to change the mapping, continue; otherwise note & use the existing mapping
  • Double click on this entry & you'll be prompted for a key binding. Hold CTRL and tap K. Ctrl + K should now be listed. Press enter to save this mapping
  • Right click the entry and select Change when expression. Type terminalFocus then press enter.
  • That's it. Now, when the terminal is in focus and you press Ctrl+K you'll get the behaviour you'd have expected to get from running clear/cls.

Visual Basic 6 causes Visual Studio 2010 to attempt an installation

This is a known problem. Apparently Office apps can cause the same behavior. Like you, I saw it when I opened a VB6 project. It's still not fixed in the RC, but there is a workaround. You just have to create a directory and the problem will go away.

We've seen similar issues fixed by
determining which directory VS expects
to be created and then creating it.
We’ve fixed this in our RTMRel product
and the Visual Studio tools for office
team has put an additional test to
check for project. To work around this
issue try creating the following
directory. Open an elevated command
prompt and type the following command
and then open project again. Let me
know if this fixes the issue.

Md "%ProgramFiles%\Microsoft
Visual Studio
10.0\common7\IDE\FromGAC"

I also encountered this problem with the Visual Studio 2005 installer. The solution was a bit more tedious, but I eventually got it to stop.

I found this article that said to look at the MsiInstaller warnings in the application event log. There were two errors every time. First an error with event ID 1004 that describes the problem. This was followed by another error with event ID 1001 which was of no use. I just created every file and folder it named in the 1004 errors and the problem went away. I was getting ready to give up because I had no idea how many files it was going to complain about, but I kept at it and finally got it to stop. These files contain nothing. I just created new text files with my file manager and renamed them. Here's what I had to create.

  • C:\Windows\Microsoft.NET\Framework\v2.0.50727\al.exe
  • C:\Windows\Microsoft.NET\Framework\v2.0.50727\al.exe.config
  • C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Build.Conversion.dll
  • C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.VisualBasic.xml
  • C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.VisualStudio.VSHelp80.xml
  • C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Vsa.xml
  • C:\Windows\Microsoft.NET\Framework\v2.0.50727\SQLServer.targets
  • C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Configuration.Install.xml
  • C:\Windows\Microsoft.NET\Framework\v2.0.50727\RedistList
  • C:\Windows\Microsoft.NET\Framework\v2.0.50727\RedistList\VSList.xml

How do I exclude a directory when using `find`?

Use the -prune primary. For example, if you want to exclude ./misc:

find . -path ./misc -prune -o -name '*.txt' -print

To exclude multiple directories, OR them between parentheses.

find . -type d \( -path ./dir1 -o -path ./dir2 -o -path ./dir3 \) -prune -o -name '*.txt' -print

And, to exclude directories with a specific name at any level, use the -name primary instead of -path.

find . -type d -name node_modules -prune -o -name '*.json' -print

How do you hide the mouse pointer under Linux/X11?

You can create and set an invisible cursor theme. This trick is used by maemo, because it's rather pointless to have a cursor on a touchscreen device.

Sadly, the ability to change the global cursor theme at runtime is not uniform across X11 applications and toolkits. You can change the server resource Xcursor.theme, and nobody will notice (generally it's only queried at startup); you can inform xsettings which only seems to affect Gtk+ programs; KDE uses some sort of communication through properties on the root window; etc.

At least changing the cursor for your own application is as easy as XDefineCursor, and if you do that on the root window, some applications might follow along.



Related Topics



Leave a reply



Submit