It depended. Generally, the flags would be cased while marching although they may be uncased and unfurled when marching through a friendly town. When preparing for action, the colors were unfurled and usually kept unfurled through the battle although there were a few instances where the flag was cased during the fighting. At Gettysburg, after more than half a dozen men fell carrying the colors, Lt. East furled and cased the flags when he saw the amount of fire that they were attracting. In anger, Sergeant-Major Blanchard grabbed the national flag and began to wave it when he a bullet cut his femoral artery and he died within minutes. Don Troiani did an excellent painting which depicts this event.
Ryan